# How to create EHR? **Category:** [Apps](https://discourse.openehr.org/c/app-dev/8) **Created:** 2023-07-24 11:21 UTC **Views:** 897 **Replies:** 3 **URL:** https://discourse.openehr.org/t/how-to-create-ehr/4272 --- ## Post #1 by @vijay_zharotia I tried posting data from https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#tag/EHR { "archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1", "name": { "value": "EHR status" }, "uid": { "_type": "OBJECT_VERSION_ID", "value": "8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1" }, "subject": { "_type": "PARTY_SELF" }, "is_queryable": true, "is_modifiable": true } it is giving following error { "error": "Bad Request", "message": "Could not resolve subtype of [simple type, class com.nedap.archie.rm.RMObject]: missing type id property '_type'\n at [Source: (String)\"{\"archetype_node_id\":\"openEHR-EHR-EHR_STATUS.generic.v1\",\"name\":{\"value\":\"EHR status\"},\"uid\":{\"_type\":\"OBJECT_VERSION_ID\",\"value\":\"8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1\"},\"subject\":{\"_type\":\"PARTY_SELF\"},\"is_queryable\":true,\"is_modifiable\":true}\"; line: 1, column: 271]" } any suggestion? --- ## Post #2 by @ian.mcnicoll You need to include the _type of the name attribute. See this example which has some handlebar' type 'varaibles in it ```javascript const ehrStatus = { _type: "EHR_STATUS", archetype_node_id: "openEHR-EHR-EHR_STATUS.generic.v1", name: { _type: "DV_TEXT", value: "ehr status" }, subject: { external_ref: { id: { _type: "HIER_OBJECT_ID", value: '{{subjectId}}', }, namespace: '{{subjectNamespace}}', type: "PERSON" // This is overwiritten to 'PARTY_REF' in BetterCDR } }, // If not specified these default to false in EhrBase and true in BetterCDR is_modifiable: true, is_queryable: true } ``` --- ## Post #3 by @vijay_zharotia Thanks Ian for the reply, I tried this and it worked and I picked this from some other link but does not give me good understanding. what is good resource to read about this topic which explain concepts better. { "_type": "EHR_STATUS", "archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1", "name": { "value": "EHR Status" }, "subject": { "external_ref": { "id": { "_type": "GENERIC_ID", "value": "ins01", "scheme": "id_scheme" }, "namespace": "examples", "type": "PERSON" } }, "is_modifiable": true, "is_queryable": true } --- ## Post #4 by @ian.mcnicoll The data structure is based on the EHR_STATUS class https://specifications.openehr.org/releases/UML/latest/index.html#Architecture___18_1_83e026d_1433773265183_363265_8874 --- **Canonical:** https://discourse.openehr.org/t/how-to-create-ehr/4272 **Original content:** https://discourse.openehr.org/t/how-to-create-ehr/4272