onaio / fhir-tooling

A command line utility to support FHIR Core content authoring
Other
2 stars 1 forks source link

FHIR Resource Meta Tags are overwritten by publishing tool #183

Closed Rkareko closed 5 months ago

Rkareko commented 5 months ago

Existing Meta tags on FHIR Resource are overwritten by the publishing tool

Sync down of the resources to client apps fails since the tags used to filter the resources are missing.

Sample FHIR Resource

{
    "id": "77f22016-a9a2-4eee-ab98-595f55fb8701",
    "meta": {
      "lastUpdated": "2023-06-02T14:50:18Z",
      "tag": [
        {
          "system": "https://smartregister.org/app-version",
          "code": "Not defined",
          "display": "Application Version"
        },
        {
          "system": "https://smartregister.org/location-tag-id",
          "code": "ABC6789",
          "display": "Practitioner Location"
        },
        {
          "system": "https://smartregister.org/organisation-tag-id",
          "code": "2c29c69f-c2d1-463f-a4b2-d90a5c2fd05d",
          "display": "Practitioner Organization"
        },
        {
          "system": "https://smartregister.org/care-team-tag-id",
          "code": "8a4c8a26-1e44-4483-bd3f-fa223d22b4a1",
          "display": "Practitioner CareTeam"
        },
        {
          "system": "https://smartregister.org/care-team-tag-id",
          "code": "4bbd81b2-f997-4500-afad-0203caf96764",
          "display": "Practitioner"
        }
      ]
    },
    "identifier": [
      {
        "use": "official",
        "value": "77f22016-a9a2-4eee-ab98-595f55fb8701"
      },
      {
        "use": "secondary",
        "value": "32"
      },
      {
        "use": "secondary",
        "value": "7bc7ec11-77d6-4271-8872-cfb033edfd21"
      }
    ],
    "active": true,
    "name": [
      {
        "use": "official",
        "given": [
          "Diya",
          "Anand"
        ]
      }
    ],
    "telecom": [
      {
        "system": "phone",
        "value": "9404504856",
        "use": "mobile"
      }
    ],
    "gender": "male",
    "birthDate": "1991-04-11",
    "address": [
      {
        "use": "home",
        "type": "physical",
        "text": "14 Basement Raheja Complex 834, Anna Salai (Park Pointe), [No GND Registered]",
        "line": [
          "14 Basement Raheja Complex 834, Anna Salai"
        ],
        "city": "Park Pointe",
        "district": "Hojai",
        "state": "Maharashtra",
        "postalCode": "260897",
        "country": "Montenegro"
      }
    ],
    "communication": [
      {
        "language": {
          "coding": [
            {
              "system": "urn:ietf:bcp:47",
              "code": "si",
              "display": "Sinhala"
            }
          ],
          "text": "Sinhala"
        }
      }
    ],
    "generalPractitioner": [
      {
        "reference": "Practitioner/4bbd81b2-f997-4500-afad-0203caf96764"
      }
    ],
    "managingOrganization": {
      "reference": "Organization/2c29c69f-c2d1-463f-a4b2-d90a5c2fd05d"
    },
    "resourceType": "Patient"
  }

Resource after processing for upload

{
      "request": {
        "method": "PUT",
        "url": "Patient/77f22016-a9a2-4eee-ab98-595f55fb8701"
      },
      "resource": {
        "identifier": [
          {
            "use": "official",
            "value": "77f22016-a9a2-4eee-ab98-595f55fb8701"
          },
          {
            "use": "secondary",
            "value": "32"
          },
          {
            "use": "secondary",
            "value": "7bc7ec11-77d6-4271-8872-cfb033edfd21"
          }
        ],
        "address": [
          {
            "country": "Montenegro",
            "city": "Park Pointe",
            "use": "home",
            "line": [
              "14 Basement Raheja Complex 834, Anna Salai"
            ],
            "district": "Hojai",
            "postalCode": "260897",
            "text": "14 Basement Raheja Complex 834, Anna Salai (Park Pointe), [No GND Registered]",
            "state": "Maharashtra",
            "type": "physical"
          }
        ],
        "gender": "male",
        "active": true,
        "birthDate": "1991-04-11",
        "managingOrganization": {
          "reference": "Organization/2c29c69f-c2d1-463f-a4b2-d90a5c2fd05d"
        },
        "meta": {
          "tag": [
            {
              "system": "https://smartregister.org/fct-release-version",
              "code": "2.3.4-SNAPSHOT"
            }
          ]
        },
        "generalPractitioner": [
          {
            "reference": "Practitioner/4bbd81b2-f997-4500-afad-0203caf96764"
          }
        ],
        "name": [
          {
            "given": [
              "Diya",
              "Anand"
            ],
            "use": "official"
          }
        ],
        "telecom": [
          {
            "system": "phone",
            "use": "mobile",
            "value": "9404504856"
          }
        ],
        "id": "77f22016-a9a2-4eee-ab98-595f55fb8701",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "system": "urn:ietf:bcp:47",
                  "code": "si",
                  "display": "Sinhala"
                }
              ],
              "text": "Sinhala"
            }
          }
        ],
        "resourceType": "Patient"
      }
    }
pld commented 5 months ago

very interesting, good catch!