Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JSON - check for empty values in required keys before transmitting

Featured Replies

I am working on a interface to submit claims to an insurance clearing house.  I am able to create the JSON and submit the claim but the clearing house won't accept some empty fields.  As a result, I would like to make sure there are not empty values in the required key/value pairs.  Is there an easy way to quickly do this after the JSON is built?

I realize it could be done when building the JSON but I'm trying to write scripts that only do one thing at a time.  Thus, a script to check the JSON before submitting it.  If there isn't, I'll just write a script to check all the FM fields before creating the JSON.

Thanks for any help you can provide.

{
    "Claims" : 
    [
        {
            "Prov_PayerID" : "APX14116",
            "Prov_VendorClaimID" : "103",
            "F00_PayerName" : "ACME HEALTH INSURANCE CO.",
            "F01A_InsuredId" : "AHI226059876",
            "F02_PatientNameFirst" : "Deanna",
            "F02_PatientNameLast" : "Troi",
            "F03_PatientDob" : "1990-03-29",
            "F03_PatientSex" : "F",
            "F04_InsuredNameFirst" : "Deanna ",
            "F04_InsuredNameLast" : "Troi",
            "F05_PatientAddress1" : "2336 Betazed",
            "F05_PatientCity" : "Some City",
            "F05_PatientState" : "XX",
            "F05_PatientZip" : "NNNNN",
            "F06_PatientRelationshipToInsured" : "Self",
            "F07_InsuredAddress1" : "2336 Betazed",
            "F07_InsuredCity" : "Some City",
            "F07_InsuredState" : "XX",
            "F07_InsuredZip" : "NNNNN",
            "F11A_InsuredDob" : "1990-03-29",
            "F11A_InsuredSex" : "F",
            "F12_PatientAuthorization" : "Yes",
            "F13_InsuredAuthorization" : "Y",
            "F21_DiagnosisCodes" : [ "H00014 ", "H47323 " ],
            "F21_IcdIndicator" : "10",
            "F24_ClaimLines" : 
            [
                {
                    "F24A_DateOfServiceFrom" : "2021-02-25",
                    "F24B_PlaceOfServiceCode" : "11",
                    "F24D_HcpcsProcedureCode" : "92004",
                    "F24E_DiagnosisPointers" : [ "A" ],
                    "F24F_Charges" : 154,
                    "X12_ProviderControlNumber" : "111"
                },
                {
                    "F24A_DateOfServiceFrom" : "2021-02-25",
                    "F24B_PlaceOfServiceCode" : "11",
                    "F24D_HcpcsProcedureCode" : "92250",
                    "F24E_DiagnosisPointers" : [ "A" ],
                    "F24F_Charges" : 68,
                    "X12_ProviderControlNumber" : "112"
                },
                {
                    "F24A_DateOfServiceFrom" : "2021-02-25",
                    "F24B_PlaceOfServiceCode" : "11",
                    "F24D_HcpcsProcedureCode" : "92285",
                    "F24E_DiagnosisPointers" : [ "A" ],
                    "F24F_Charges" : 43,
                    "X12_ProviderControlNumber" : "113"
                }
            ],
            "F28_TotalCharge" : 265,
            "F31_PhysicianOrSupplierSignatureIsOnFile" : true,
            "F33A_BillingProviderNpi" : "",
            "F33_BillingProviderAddress1" : "849 E. 400 So.",
            "F33_BillingProviderCity" : "Some City",
            "F33_BillingProviderNameFirst" : "",
            "F33_BillingProviderNameLast" : "",
            "F33_BillingProviderPhoneNumber" : "xxx-xxx-xxx",
            "F33_BillingProviderState" : "XX",
            "F33_BillingProviderZip" : "NNNNN"
        }
    ],
    "DocumentType" : "MedicalClaim"
}

Edited by JMW
Clarity

3 hours ago, JMW said:

Is there an easy way to quickly do this after the JSON is built?

If by "easy" and "quickly" you mean without looping over all the required keys and checking each one individually, then I am afraid the answer is no. JSON is not XML. There is no equivalent of XPath language that would allow you to select "any element that does not have a child element or a text node".*

Technically, it should be possible to traverse the entire tree using a script that calls itself recursively. However, I suspect it wouldn't be easy to write nor quick to execute. 

--
(*) At least not using Filemaker JSON functions - it might be possible using JavaScript in a web viewer, or a plugin.

 

Edited by comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.