var resource = { "resourceType": "Patient", "id": "12345", "text": { "status": "generated", "div": "<div><p>Test Patient</p></div>" }, "identifier": [ { "use": "usual", "type": { "coding": [ { "system": "http://hl7.org/fhir/v2/0203", "code": "MR", "display": "Medical record number" } ], "text": "Medical record number" }, "system": "http://hospital.smarthealthit.org", "value": "12345" } ], "active": false, "name": [ { "use": "official", "family": [ "Patient" ], "given": [ "Test" ] } ], "gender": "female", "birthDate": "2007-03-20", };
Team,
I am trying to use smart-fhir javascript client(https://github.com/smart-on-fhir/client-js/blob/master/dist/fhir-client.js) to communicate to our existing fhir-service.
I am able to retrieve FHIR resource and I could also save or update the fhir resource with the help of below tutorial
My Question here is (its based on write example above),
When we try to do write operation (create new resource), we have to build the whole resource object explicitly with javascript object (eg: patient resource in json) and there is no way to validate the json structure unless the fhir service validate it and throw the exception.
Unlike python library we don't have models for FHIR resources in javascript library, Is there any approach like creating a Patient resource from a schema or validating against it?
I know this is not a blocking issue or an use case, just trying to understand the best practice here, any suggestion will be great.
below code is example of a Patient resource,
var resource = {
"resourceType": "Patient",
"id": "12345",
"text":< /span> {
"status": "generated",
"div" : "<div><p>Test Patient</p></div>"
},
"identifier": [
{
"use": "usual",
"type": {
"coding": [
{
"system": "http://hl7.org/fhir/v2/0203",
"code": "MR",
"display": "Medical record number"
}
],
"text": "Medical record number"
},
"system": "http://hospital.smarthealthit.org",
"value": "12345"
}
],
"active" : false,
"name":< /span> [
{
"use": "official",
"family": [
"Patient"
],
"given": [
"Test"
]
}
],
"gender" : "female",
"birthDate": "2007-03-20",
};
--
Thanks,Vijay
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.