Unable to add Practitioner in fhir api request

Situation
I’m trying to post the Practitioner details via fhir call, but the in the response we are asked to enter the fname, lname, so on, but in the fhir document there is no such.
The swagger documentation for the fhir has not listed the post body for the most requests, I think this would help the Developers understand and integrate with openemr.

here is the request body:

{
“resourceType”: “Practitioner”,
“active”: true,
“name”: [
{
“family”: “Williams”,
“given”: [
“Rory”,
“James”
],
“prefix”: [
“Dr.”
],
“suffix”: [
“M.D.”
],
“period”: {
“start”: “2019-12-01T00:00:00.000Z”
}
}
],
“identifier”: [
{
“assigner”: {
“reference”: “Organization/675844”
},
“type”: {
“coding”: [
{
“code”: “DEA”,
“system”: “http://terminology.hl7.org/CodeSystem/v2-0203
}
]
},
“system”: “urn:oid:2.16.840.1.113883.4.814”,
“value”: “CW1234563”,
“period”: {
“start”: “2019-12-01T00:00:00.000Z”,
“end”: “2029-12-01T23:59:59.000Z”
}
}
]
}

response :

{
“validationErrors”: {
“fname”: {
“Required::NON_EXISTENT_KEY”: “fname must be provided, but does not exist”
},
“lname”: {
“Required::NON_EXISTENT_KEY”: “lname must be provided, but does not exist”
},
“npi”: {
“Required::NON_EXISTENT_KEY”: “npi must be provided, but does not exist”
}
}
}

OpenEMR Version
I’m using OpenEMR version v6.0.0

Browser:
chrome
Operating System
docker

I’d be very skeptical of the POST/PUT requests with the FHIR api. I didn’t touch any of the POST/PUT implementations when I went through and implemented all of the GET requests to ensure we were spec compliant to FHIR’s US Core IG 3.1 (which is based on FHIR R4).

That said if you need this functionality you can send us a git pull request and we’d be happy to review your code contribution.

Working on updating documentation for that POST endpoint here:
working towards g7 for mu3 by bradymiller · Pull Request #5044 · openemr/openemr · GitHub

Here is a current working example that will work in the Try it out input box in swagger:

{
  "id": "9473b0cf-e969-4eaa-8044-51037767fa4f",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2021-09-21T17:41:57+00:00"
  },
  "resourceType": "Practitioner",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"> <p>Billy Smith</p></div>"
  },
  "identifier": [
    {
      "system": "http://hl7.org/fhir/sid/us-npi",
      "value": "11223344554543"
    }
  ],
  "active": true,
  "name": [
    {
      "use": "official",
      "family": "Smith",
      "given": [
        "Billy"
      ]
    }
  ]
}

btw, agree with @adunsulag , that the functionality of the current fhir post endpoints is likely very basic.

Sorry for all the posts, but I just noted you are using 6.0.0. It is very possible/likely that will need 6.1.0 for my example to work.

This is working on as well v6.0.0, able to send post request for the Practitioner. @brady.miller

Tested with the following request :

{
    "resourceType": "Practitioner",
    "identifier": [
        {
            "system": "http://hl7.org/fhir/sid/us-npi",
            "value": "11223344554543"
        }
    ],
    "active": true,
    "name": [
        {
            "use": "official",
            "family": "Will",
            "given": [
                "Sam",
                "Falco"
            ],
            "prefix": [
                "Doctor"
            ],
            "suffix": [
                "M.D."
            ],
            "period": {
                "start": "2019-03-07T20:40:35.000Z"
            }
        }
    ],
    "telecom": [
        {
            "system": "phone",
            "value": "7861231234",
            "use": "work"
        },
        {
            "system": "email",
            "value": "falco.lombardi@sfox.com",
            "use": "work"
        }
    ],
    "address": [
        {
            "use": "work",
            "text": "111 Corneria Dr.\\nTallahassee, FL 32304\\nUSA",
            "line": [
                "111 Corneria Dr."
            ],
            "city": "Tallahassee",
            "district": "Leon",
            "state": "FL",
            "postalCode": "32304",
            "country": "USA"
        }
    ],
    "gender": "male",
    "qualification": [
        {
            "code": {
                "coding": [
                    {
                        "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/29600",
                        "code": "677091",
                        "display": "MD",
                        "userSelected": true
                    }
                ],
                "text": "MD"
            },
            "period": {
                "start": "2014-07-09T06:00:00.000Z"
            }
        },
        {
            "code": {
                "coding": [
                    {
                        "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/29600",
                        "code": "677079",
                        "display": "PhD",
                        "userSelected": true
                    }
                ],
                "text": "PhD"
            },
            "period": {
                "start": "2014-07-09T06:00:00.000Z"
            }
        }
    ]
}

GET against Practitioner id is giving the following response:

{
    "id": "9600f336-bac2-44ff-a57d-106e25037746",
    "meta": {
        "versionId": "1",
        "lastUpdated": "2022-04-07T05:11:06+00:00"
    },
    "resourceType": "Practitioner",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"> <p>Sam Will</p></div>"
    },
    "identifier": [
        {
            "system": "http://hl7.org/fhir/sid/us-npi",
            "value": "11223344554543"
        }
    ],
    "active": true,
    "name": [
        {
            "use": "official",
            "family": "Will",
            "given": [
                "Sam",
                "Falco"
            ],
            "prefix": [
                "Doctor"
            ]
        }
    ],
    "telecom": [
        {
            "system": "phone",
            "value": "7861231234",
            "use": "work"
        },
        {
            "system": "email",
            "value": "falco.lombardi@sfox.com",
            "use": "home"
        }
    ],
    "address": [
        {
            "line": [
                "111 Corneria Dr."
            ],
            "city": "Tallahassee",
            "state": "FL",
            "postalCode": "32304"
        }
    ]
}

So based on the get request, can we only store the name, telecom, npi ?

There is also database error which I have posted in the following thread : Query Error on the call to medical_problem endpoint against patient uuid , if this can be resolved.

Thank you.