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

Registration Step #46

Open
kchapple opened this issue Sep 27, 2016 · 1 comment
Open

Registration Step #46

kchapple opened this issue Sep 27, 2016 · 1 comment
Assignees
Labels

Comments

@kchapple
Copy link
Collaborator

If the client posts a Patient resource to /register, we should

  1. Parse out the provider
  2. Figure out which connection to use (for now from database.php) by getting the connection out of the provider table
  3. Store the patient in the EHR database using the appropriate connection by calling setConnection() on the repository or the models itself.
  4. Store a reference to the connection and ehr_pid in the users table (this needs to be added)
  5. Build a JSON response
  • I added connection field to provider table.
  • I parsed out Provider ID and got connection, see storeInterface() method on FHIRPatientAdapter
    TODO
  • add ehr_pid and connection fields to users table
  • Make a RegisterController that uses the FHIRPatientAdapter to store the POSTed Patient Resource into the EHR database corresponding to profider, and add route /register
  • Enhance routing so that we can pass the connection name to the API server like this https://gponline-fhir.vu2vu.com/fhir/mysql/Patient/47 where mysql is the connection key. Then set that connection key in the FHIR***Adapter so that the repository that talks to the EHR will use the correct connection. This is because we don't want to pass the provider with every request. A user will not be allowed to change providers in this version.
  • JSON request and JSON response look like this (notice in the response, that the connection name is in the path):

`Sample request to /register
{
"resourceType": "Patient",
"name": [
{
"use": "usual",
"family": [
"Everywoman3"
],
"given": [
"Judy Simple"
]
}
],
"telecom": [
{
"system": "phone",
"value": "555-555-2003",
"use": "primary"
},
{
"system": "email",
"value": "",
"use": "primary"
}
],
"gender": "female",
"birthDate": "1955-01-06",
"address": [
{
"use": "home",
"line": [
"45 pine st",
"Mt eden"
],
"city": "Auckland"
}
],
"extension": [
{
"url": "https://gponline-fhir.vu2vu.com/gponline-patient-extensions",
"extension": [
{
"url": "#groupId",
"valueString": ""
},
{
"url": "#status",
"valueString": "pending"
},
{
"url": "#providerId",
"valueString": "34"
},
{
"url": "#pharmacyId",
"valueString": "5"
},
{
"url": "#stripeToken",
"valueString": "some-value"
}
]
}
]
}

Sample response from /register

{
"resourceType": "Bundle",
"type": "transaction-response",
"total": 1,
"entry": [
{
"fullUrl": "https://gponline-fhir.vu2vu.com/fhir/mysql/Patient/47",
"resource": {
"id": 47,
"resourceType": "Patient",
"identifier": [
{
"use": "usual",
"value": 47
}
],
"name": [
{
"use": "usual",
"family": ["Everywoman3"],
"given": ["Judy Simple"]
}
],
"telecom": [
{
"system": "phone",
"value": "555-555-2003",
"use": "primary"
},
{
"system": "email",
"value": "",
"use": "primary"
}
],
"gender": "female",
"birthDate": "1955-01-06",
"address" : [
{
"use" : "home",
"line" : [
"45 pine st",
"Mt eden"
],
"city" : "Auckland"
}
],
"extension" : [
{
"url" : "https://gponline-fhir.vu2vu.com/extensions/gponline-patient-data",
"extension" : [
{
"url" : "#groupId",
"valueString" : "1001"
},
{
"url" : "#status",
"valueString" : "pending"
},
{
"url" : "#providerId",
"valueString" : "34"
},
{
"url" : "#pharmacyId",
"valueString" : "5"
},
{
"url" : "#stripeToken",
"valueString" : "some-value"
}
]
}
]
},
"response": {
"status": "201 Created",
"location": "Patient/47"
}
}
]
}
`

@Leo24
Copy link
Contributor

Leo24 commented Sep 29, 2016

Add RegisterController and amend PatientAdapter for Registration Step
#49
LibreHealthIO/lh-ehr-api#19

kchapple pushed a commit that referenced this issue Sep 30, 2016
* Add ehr_pid column to users table

* Add RegisterController and amend PatientAdapter for Registration Step #46

* Add functionality for storing connection and ehr_pid to users table
@kchapple kchapple self-assigned this Oct 3, 2016
kchapple pushed a commit that referenced this issue Jan 5, 2017
* Add ehr_pid column to users table

* Add RegisterController and amend PatientAdapter for Registration Step #46

* Add functionality for storing connection and ehr_pid to users table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants