Resource validation against US Core R4 profile

202 views
Skip to first unread message

Sumanth Satheesh

unread,
Sep 17, 2020, 6:26:00 AM9/17/20
to HAPI FHIR
Hi Team,

I am working on building up the patient resource with HAPI FHIR Plain server and i need to validate the patient resource against the structure definition of the US core profile, Can anyone point me out to the sample  java code to validate resource  against the structure definition of US Core R4.

Any help is much appreciated.

Thanks 
Sumanth S 

Hanan Awwad

unread,
Sep 17, 2020, 4:32:13 PM9/17/20
to HAPI FHIR
try something like the following:

POST {{url}}/Claim/$validate

{
    "resourceType": "Claim",
    "id": "100467",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable rendering of the Oral Health Claim</div>"
    },
    "meta": {
        "versionId": "1",
        "lastUpdated": "2019-11-26T19:46:01.410+00:00",
        "source": "#Y0SivEcOMHnsJFLI",
        "profile":[
        ]
    },
    "status": "active",
    "type": {
        "coding": [
            {
                "system": "http://terminology.hl7.org/CodeSystem/claim-type",
                "code": "institutional"
            }
        ]
    },
    "use": "claim",
    "patient": {
        "reference": "Patient/100221",
        "display": "Kennith515 McDermott739"
    },
    "billablePeriod": {
        "start": "2016-06-05T14:28:50-04:00",
        "end": "2016-06-05T14:47:50-04:00"
    },
    "created": "2016-06-05T14:47:50-04:00",
    "provider": {
        "reference": "Organization/100223",
        "display": "PCP37019"
    },
    "priority": {
        "coding": [
            {
                "system": "http://terminology.hl7.org/CodeSystem/processpriority",
                "code": "normal"
            }
        ]
    },
    "facility": {
        "reference": "Location/100222",
        "display": "PCP37019"
    },
    "supportingInfo": [
        {
            "sequence": 1,
            "category": {
                "coding": [
                    {
                        "system": "http://terminology.hl7.org/CodeSystem/claiminformationcategory",
                        "code": "info"
                    }
                ]
            },
            "valueReference": {
                "reference": "Immunization/100463"
            }
        }
    ],
    "procedure": [
        {
            "sequence": 1,
            "procedureReference": {
                "reference": "Procedure/100462"
            }
        }
    ],
    "insurance": [
        {
            "sequence": 1,
            "focal": true,
            "coverage": {
                "display": "Medicaid"
            }
        }
    ],
    "item": [
        {
            "sequence": 1,
            "productOrService": {
                "coding": [
                    {
                        "system": "http://cchi.gov.sa/terminology/CodeSystem/adjudication-outcome",
                        "code": "pended1",
                        "display": "pended"
                    }
                ],
                "text": "General examination of patient (procedure)"
            },
            "encounter": [
                {
                    "reference": "Encounter/100444"
                }
            ]
        }
    ],
    "total": {
        "value": 129.16,
        "currency": "USD"
    }
}

Elano

unread,
Oct 1, 2020, 9:00:05 AM10/1/20
to HAPI FHIR
Hi, 
one small question. 
In your JSON example, is the field meta.profile required for this validation? 
Or is it possible to post this JSON without this value? I mean, will FHIR Server validate it even without this field? Maybe based on a default profile for the resource type?

Regards,
Elano

Hanan Awwad

unread,
Oct 1, 2020, 11:23:01 AM10/1/20
to HAPI FHIR
Sure just remove the profile tag so as to validate from standard structure definition 

Elano

unread,
Oct 1, 2020, 11:35:53 AM10/1/20
to HAPI FHIR
Yes, 
I was expecting like that, but in my case, when I remove the profile tag, the resource is no more validated. It works only when I have this tag in the resource. Ideas why?
Thks

Elano Machado

unread,
Oct 1, 2020, 4:26:30 PM10/1/20
to HAPI FHIR
yes, I can post this JSON without this value (meta.profile). In this case, the FHIR Server accepts it, but not based on my own profile. As you said, maybe based on a default one.
Is it possible to set a default profile for a specific resource type? Something like: All Patients without a filed meta.profile will be validated against a default profile? Where can I check or set it in hapi fhir?

Thanks for your help

--
You received this message because you are subscribed to a topic in the Google Groups "HAPI FHIR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hapi-fhir/GujiJOrg5UY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/9000e694-4f22-4ff0-973d-d79896e761d6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages