Skip to content

Conversation

@ppazos
Copy link

@ppazos ppazos commented Oct 31, 2022

Some types were not validating using the *all JSON schemas and detected some entry points were missing, then checked other internal structures and detected other issues and some simplifications/formalizations. These changes were validated against each RM version. The *api schemas are based on the openEHR REST API payloads that have some OBJECT_REFs resolved to the actual object. Also the schemas for RM 1.0.2 were not included, I have created them by modifying the 1.0.3 schemas.

To check the specific changes, just do a diff from the RM schema to the corresponding schema currently published by the SEC.

For context check this thread https://discourse.openehr.org/t/multi-rm-json-schema-validation-and-current-schema-issues/3002

@pieterbos this is a list of changes:

  1. Demographic top-level classes were not included in the root validator (entry point if-then in the schemas), including: ROLE, AGENT, GROUP, PERSON and ORGANIZATION.
  2. EHR.ehr_access won't be of type PARTY_REF, so I removed it (and I guess it won't be LOCATABLE_REF neither but I need confirmation from the SEC)
  3. EHR.ehr_status won't be PARTY_REF or ACCESS_GROUP_REF, so I removed those options.
  4. EHR.directory won't be PARTY_REF or ACCESS_GROUP_REF, removed both
  5. EHR.compositions won't PARTY_REF or ACCESS_GROUP_REF, removed both
  6. EHR.contributions won't be LOCATABLE_REF, PARTY_REF or ACCESS_GROUP_REF, removed those options leaving only OBJECT_REF
  7. PERSON.roles and PERSON.languages (really for all ACTOR's) in RM 1.0.3, added archetype_details as required, removed roles and languages from required.
  8. Removed type ISO8601_TYPE from the RM 1.0.3 schema (I think because that type wasn't defined in that RM version, would need to double check)
  9. Items in CONTRIBUTION.versions won't be LOCATABLE_REF, PARTY_REF or ACCESS_GROUP_REF so I removed them, the only option is OBJECT_REF.
  10. ORIGINAL_VERSION.contribution won't be LOCATABLE_REF, PARTY_REF or ACCESS_GROUP_REF, only OBJECT_REF.
  11. ORIGINAL_VERSION.data could be any of the top level LOCATABLE classes: COMPOSITION, FOLDER, EHR_STATUS, ROLE, AGENT, GROUP, ORGANISATION, PERSON. Before this was just "object" in the schema, so it doesn't validation the version.data at all.
  12. X_VERSIONED_PARTY.owner_id I think won't be LOCATABLE_REF, PARTY_REF or ACCESS_GROUP_REF, I removed them.
  13. DV_QUANTITY doesn't have a property named "property" in the RM, this was introduced because the AOM uses that property but it's from the C_DV_QUANTITY from the Archetype Profile model, so if it's not part of the RM, it shouldn't be part of the JSON schema based on the RM.
  14. X_VERSIONED_COMPOSITION.owner_id I think won't be LOCATABLE_REF, PARTY_REF or ACCESS_GROUP_REF, I removed them. (same with X_VERSIONED_EHR_ACCESS, X_VERSIONED_OBJECT)
  15. EXTRACT_ENTITY_MANIFEST.other_ids was "object" and I changed that to array in RM 1.0.3
  16. RESOURCE_DESCRIPTION_ITEM.other_details removed from required
  17. FOLDER.archetype_details changed to required (I know this change might need to be reverted since the top level FOLDERs might have archetype_details but the subfolders might not, though there is sufficient information in systems to set the archetype_details of all the FOLDERs)
  18. ORGANISATION added archetype_details as required and removed roles and languages from required (RM 1.0.3)
  19. DV_EHR_URI added value as required
  20. COMPOSITION added archetype_details as required (though it is optional in the model, this is required for all top level classes to be able to get the template_id to validate the LOCATABLE (this comment also applies to other classes like ORGANISATION, PERSON, AGENT, FOLDER, EHR_STATUS, ROLE, etc. mentioned above) To be correct this can be removed and the check be implemented as a rule in the software.
  21. EHR_STATUS added archetype_details as required.
  22. IMPORTED_VERSION.contributions removed possible types LOCATABLE_REF, PARTY_REF and ACCESS_GROUP_REF, since those won't be used there.
  23. DV_URI.value added as required, it was missing.
  24. ACTIVITY.action_archetype_id added to required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants