Closed saravanakumargs closed 3 years ago
To get a specific resource data make a get for that resource like Patient -- if you need patient specific data [GET]https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Patient -- will list top 20 record In response body you can find the patient Id and provider/Practitioner details. based on patient or provider you can make API calls. for example [GET]https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/RelatedPerson?patient=1902008249235680 Most of the API calls are supporting 'patient' as a search parameter. please look at the https://mydata.athenahealth.com/fhirapidoc for supported search parameter for specific API's. I have provide one sample payload to create a patient. [POST]https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Patient Patient.txt
To get the data for all the API calls like, Providers available, Slot , Appointment etc., Please make get call for corresponding API and do some analysis on response body.
HI,
After login with personal account, I am trying to get the schedule of the Practitioner. But getting unauthorized error.
2) Get the Bearer Token using the URL - https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/oauth2/token
3) Got the belo response:
a) Bearer token
b) Scope: patient/BasicPosting.read patient/Medication.read patient/Immunization.read patient/OperationDefinition.read patient/DocumentReference.read patient/Procedure.read patient/ValueSet.read patient/BasicAccount.read patient/Slot.read patient/MedicationAdministration.read patient/Condition.read patient/CarePlan.read patient/Practitioner.read launch/patient patient/Coverage.read openid profile patient/Appointment.read patient/Goal.read patient/AllergyIntolerance.read patient/Schedule.read patient/MedicationOrder.read patient/ProcedureRequest.read patient/RelatedPerson.read patient/FamilyMemberHistory.read patient/NamingSystem.read patient/Device.read patient/Patient.read patient/Location.read patient/DiagnosticOrder.read patient/ConceptMap.read patient/Observation.read patient/MedicationStatement.read patient/Organization.read patient/Encounter.read patient/Binary.read patient/ReferralRequest.read patient/BasicAdvanceDirective.read
4) Got the patient Information:
https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Patient?_format=json using the Bearer Token.
In the patient response got the practitioner id - {
"url": "http://hl7.org/fhir/StructureDefinition/ge-patient-extension-RESPPROVID",
"valueReference": {
"reference": "Practitioner/1225652472001060"
}
},
5) Calling Schedule with the Parctitioner -https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Schedule?actor=Practitioner/1225652472001060&_format=json
Getting the error as Unauthorized. (Tried refreshing the token many times)
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Not authorized"
}
]
Can you please let me know if I am doing anything wrong.
Thanks, Saravana
Please check the scope of the bearer token which you have generated and also look at the gihub issue #167 to create an access token which will valid for 1hrs. Try to generate the access token from provider workflow https://mydata.athenahealth.com/access-the-apis.
In the Bearer Token scope - I see the patient/Schedule.read available.
We are developing the Patient Flow to get the Schedule of the Provider and Display to Patient and they will select the slot and book the appointment
I have tried with the provider flow also,
I am able to call the below method https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Patient?_format=json
But when calling the below method getting the 401. https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Schedule?_format=json&actor=Practitioner%2F1225652472001060.
Can you please provide all the API example in the Sandbox or any demo app available to try all the api in sandbox.
Do you have any update on this??
@AjeetYadav07 Please suggest an Patient/Location/Practitioner Id for I can get appointment records. I tried with multiple Patient/Location/Practitioner, but the response is same as "total": 0, { "resourceType": "Bundle", "id": "1.2.840.113619.21.1.8899560752578716278.10.1614580669844.131229", "meta": { "lastUpdated": "2021-03-01T06:37:49.844Z" }, "type": "searchset", "total": 0, "link": [ { "relation": "self", "url": "https://cpsapisandbox.virenceaz.com:9443/demoAPIServer/fhir/Appointment?_format=json&patient=1902008249235680" } ] }
Also Suggest the Billing/Invoice API End Points.
Appointment without any search parameters will return OperationOutcome indicating Appointment resource requires location parameter to be able to search across patients. The location ids can be discovered by querying Location resource.
Location resource can be searched across patients without any search parameters. Location?_count=50
Extract location ids with prefix “FAC-“ for facilities.
Query Appointment by a list of facilities Appointment?location=FAC-403,FAC-404,FAC-405,FAC-406. Please look at github issue #140 and #136
Supported resources are listed here at https://mydata.athenahealth.com/fhirapidoc
@saravanakumargs FHIR Schedule resources can be read with user scope but not with patient scope. This is working as designed. Access tokens with patient scope are not allowed to access Schedule resource because patient scope should not be allowed to access user schedules. Patient scope would be allowed to access appointments related to the patient but not to access the definition of a Schedule for a Practitioner.
This has been put on the list for fixing in a future release. Access tokens with patient scope should not include patient/Schedule.read.
Research and discussion is needed to determine if/how patient-facing app could allow patients to schedule appointments. Most customers would not want to allow patients to schedule appointments directly. Instead, there would need to be some interaction with clinic staff to schedule appointments when responding to requests from patients.
@ARCSIndia Account and Posting are the only Practice Management APIs supported for billing, and these are supported for only CPS and athenaPractice but not for CEMR or athenaFlow.
GET [base]/fhir/$Account GET [base]/fhir/$Posting
Both of these APIs are extensions of the Basic Resource because FHIR DSTU2 does not have any resource types that could be mapped.
The Posting API documentation page mentions APIs for creating and deleting payments from a patient account. POST [base]/fhir/$PostPayment DELETE [base]/fhir/$deletePayment
Issue #141 has details about these APIs. https://github.com/athenahealth/apiserver-athenaFlex/issues/141#issuecomment-652323513 has sample resource ids that can be used with our API sandbox server.
Can you provide the Test Data available in the Sandbox environment and sample Input for all the API calls.
We are successfully able to authenticate and get the token to call the API.
Can you please share the test data for all the API calls like, Providers available, Slot , Appointment etc.,