Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FM2-126 Add support for mapping OpenMRS attribute types to FHIR #558

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

parthfloyd
Copy link

FM2-456: Add Person Attribute Extensions Support to Patient Translator

Description of what I changed

Added support for handling person attributes as FHIR extensions in the Patient resource. Person attributes in OpenMRS can now be properly translated to and from FHIR extensions (Currently supporting String, Boolean, Concept & Location).

The implementation:

  1. Adds a dependency on PersonAttributeTranslatorImpl for translation
  2. Creates getPersonAttributeExtensions method to convert attributes to extensions
  3. Updates toFhirResource to add extensions to the Patient resource
  4. Updates toOpenmrsType to convert extensions back to OpenMRS person attributes

The implementation expects person attribute extensions to follow this nested structure:

{
  "extension": [
    {
      "url": "http://fhir.openmrs.org/person-attribute",
      "extension": [
        {
          "url": "http://fhir.openmrs.org/person-attribute#Birthplace",
          "valueString": "Lisbon"
        }
      ]
    }
  ]
}

Where:

  • Outer extension with URL http://fhir.openmrs.org/person-attribute serves as a container
  • Inner extensions represent individual attributes with type-specific values

Issue I worked on

see https://openmrs.atlassian.net/browse/FM2-126

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the [code style](https://wiki.openmrs.org/display/docs/Java+Conventions) of this project.

  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

  • All new and existing tests passed.

  • My pull request is based on the latest changes of the master branch.

cc: @icrc-jofrancisco , @icrc-fdeniger , @ibacher

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.

1 participant