Stream: finnish PHR
Topic: Responses with data included
Elena Oat (Apr 20 2019 at 01:23):
Hi, I am implementing PHR for a website. I created some test accounts, so there's no data associated with neither of them. Hence, querying for Observation resource doesn't return any data. Is there a way to mock this? Or is there another way to return some fake data for patients when testing?
Elena Oat (Apr 20 2019 at 17:43):
Anyone who could help me with this?
Elena Oat (Apr 20 2019 at 17:53):
I've tried creating a resource with this data:
"resourceType":"Observation", "meta":{ "profile": [ "http://phr.kanta.fi/StructureDefinition/fiphr-bloodglucose-stu3" ] }, "language":"en", "extension": [ { "url":"http://phr.kanta.fi/StructureDefinition/fiphr-unsignedint", "valueUnsignedInt":"8" } ], "identifier": [ { "system":"urn:ietf:rfc:3986", "value":"urn:uuid:206fc986-517a-4054-bc0a-03eb906c9571" } ], "status":"final", "category": [ { "coding": [ { "system":"http://hl7.org/fhir/observation-category", "code":"vital-signs" } ] } ], "code":{ "coding": [ { "system":"http://loinc.org", "code":"14743-9", "display":"Glucose [Moles/volume] in Capillary blood by Glucometer" } ] }, "subject":{ "reference":"Patient/25a53703-27f9-4354-8f1b-a8b2f8f3ee86" }, "effectiveDateTime":"2017-11-20T11:46:00+02:00", "issued":"2017-11-20T11:46:00+02:00", "performer": [ { "reference":"Patient/25a53703-27f9-4354-8f1b-a8b2f8f3ee86" } ], "valueQuantity":{ "value":"7", "unit":"mmol/l", "system":"http://unitsofmeasure.org", "code":"mmol/L" } }``` But I am getting error as a response.
Elena Oat (Apr 20 2019 at 18:04):
The error I am seeing is related to element text. It must be present, but even if I add I still get an error.
Eeva Turkka (Apr 23 2019 at 06:37):
I'm assuming the error message is something along these lines:
{"issue":[{"severity":"error","diagnostics":"Error parsing JSON: the primitive value must be a number","code":"processing","location":["/Observation/extension/value[x]"]},{"severity":"error","diagnostics":"Error parsing JSON: the primitive value must be a number","code":"processing","location":["/Observation/value[x]/value"]},{"severity":"error","diagnostics":"Profile http://phr.kanta.fi/StructureDefinition/fiphr-bloodglucose-stu3, Element 'Observation.text': minimum required = 1, but only found 0","code":"processing","location":["Observation"]}],"resourceType":"OperationOutcome"}
One error is that the text = narrative is missing but another one is related to datatypes. The value must be integer, but you have a String there. " "valueUnsignedInt":"8", is String, "valueUnsignedInt": 8 would be integer
Elena Oat (May 04 2019 at 17:20):
@Eeva Turkka How does one write an application if you don't know how the data looks like. The https://simplifier.net/guide/FinnishPHRImplementationGuideAT/Minimumdatacontent13 page doesn't contain examples for all cases. For example, in case I want to get the data about medication that a patient is taking.
How does one create/access the examples? Can I create/get some fake data to test for my application?
Eeva Turkka (May 06 2019 at 05:16):
The profiles describe the limitations that PHR has on the FHIR resources, so if you can also take a look at the profile itself (https://simplifier.net/finnishphr/fiphr-medicationstatement-stu3) and see which limitations it has on the full FHIR MedicationStatement resource should help with what kind of resource is needed. All the datatypes etc in the fields should match the ones in the standard: if something is a String (like the "note" field), it is string in the resource, etc for all other fhir datatypes.
In the sandbox environment using faked test data is mandatory, since it is fully open to everyone.
Last updated: Apr 12 2022 at 19:14 UTC