How to reduce the validation time of json files

Hi, I’m trying to validate large amounts of json files and the amount of time taken is roughly 9-7seconds per json file. Is there a way I can further reduce the time to validate it?

How I test the validator is through terminal with this command.

java -jar /opt/nifi/extra/validator_cli.jar /opt/nifi/temp/input.json -version 4.0.1 -ig http://hl7.org/fhir/uv/ips/

And my json file tested has a format like this.

{
    "resourceType": "Bundle",
    "type": "transaction",
    "entry": [
        {
            "resource": {
                "resourceType": "Patient",
                "id": "FF8A0E9F8133F520E8CBFA8DB6566AB9A04EB9EE2ED5790C7143276267BE9088",
                "contact": [
                    {
                        "relationship": [
                            {
                                "coding": [
                                    {
                                        "extension": [
                                            {
                                                "url": "/harmonization/extension/result",
                                                "valueString": "FailureSystemUnmappable"
                                            }
                                        ],
                                        "system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
                                        "code": "MTH",
                                        "display": "Mother"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "request": {
                "method": "POST",
                "url": "Patient"
            }
        }
    ]
}

I imagined that the validator can validate a bunch of files without loading the core files and ips files repeatedly. That should reduce the time to validate them. I had looked through this documentation but I couldn’t find a way to do so.

I’m new to fhir so perhaps there is something I missed or don’t understand. Are there other ways to reduce the validation time? Please let me know, thank you!

the delay is the validator loading all the data it needs - about 7 seconds.

You can pass a wildcard to the validator, or a list of files, and validate more than one file at once.

if you want something more than that… you can host the validator as a web server, or load the java classes yourself and just do the validation once and then validate as you want.

1 Like