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

Building and Testing Fern Definitions #1217

Merged
merged 57 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e3d3964
feat(sdk): java tests move and first test rewritten
jonahkaye Nov 22, 2023
4019e89
feat(sdk): create facility
jonahkaye Nov 22, 2023
a017b8f
feat(sdk): waiting on contacts definition release
jonahkaye Nov 22, 2023
cd178b0
Merge branch 'develop' into 1212-test-migration-python-sdk-tests
jonahkaye Nov 22, 2023
e080497
feat(sdk): yaml def changes and get,post working
jonahkaye Nov 22, 2023
d1caa48
feat(sdk): yaml def changes and get,post working
jonahkaye Nov 22, 2023
5dde81d
feat(sdk): updating defiitions
jonahkaye Nov 23, 2023
b0e540d
feat(sdk): updating defiitions
jonahkaye Nov 23, 2023
609f3a4
feat(sdks): requestdd for documentquery in fern
jonahkaye Nov 23, 2023
c725147
feat(sdks): list document request update fern
jonahkaye Nov 23, 2023
cb88978
feat(sdks): update document reference, createDocumentReference endpoint
jonahkaye Nov 24, 2023
ff95013
feat(sdks): compiling
jonahkaye Nov 24, 2023
46d8f9c
feat(sdks): testing changes complete. waiting on bug resolution and f…
jonahkaye Nov 24, 2023
4652dc3
🌿 Metriport Fern Definition exports FHIR schemas (#1188)
dsinghvi Nov 27, 2023
cb117bd
feat(sdks): merged deeps changes
jonahkaye Nov 27, 2023
e227774
feat(sdks): update reqs
jonahkaye Nov 27, 2023
39fd99e
Merge branch 'develop' into 1212-test-migration-python-sdk-tests
jonahkaye Nov 30, 2023
df2433b
🌿 Setup Local Java Project to setup Java SDK Testing (#1220)
dsinghvi Nov 30, 2023
eb51d87
feat(sdks): organizing things properly
jonahkaye Nov 30, 2023
d6d92d7
feat(sdks): removing fhir
jonahkaye Nov 30, 2023
2fd0655
feat(sdks): merging w/ develop
jonahkaye Dec 4, 2023
f833366
feat(sdk): java code
jonahkaye Dec 4, 2023
e5463b1
feat(sdk): java bug I cant solv. I think fern issue
jonahkaye Dec 5, 2023
86ed8bd
feat(sdk): java bug I cant solv. I think fern issue
jonahkaye Dec 5, 2023
2556a8b
add back in fern deps and bump generator versions
armandobelardo Dec 13, 2023
8d6598c
Merge pull request #1326 from armandobelardo/fern/fhir-confirm
jonahkaye Dec 18, 2023
3b3591d
feat(fern): adding fhir and updating java fern version
jonahkaye Dec 18, 2023
d7dc2cd
feat(sdks): merging develop to branch
jonahkaye Dec 18, 2023
3ed246e
bump FHIR and Java Fern versions to actually compile
armandobelardo Dec 20, 2023
604a1a6
testing ts as well
armandobelardo Dec 20, 2023
89d6450
Merge pull request #1359 from armandobelardo/ab/compile
jonahkaye Dec 21, 2023
b9f4673
feat(sdks): updating get consolidated status response type
jonahkaye Dec 21, 2023
9b3d7e4
feat(sdks): python and java work. ts wip
jonahkaye Dec 21, 2023
7603f5d
feat(sdks): ts working
jonahkaye Dec 21, 2023
1b18922
feat(sdks): python tests passing and modifications to fern def
jonahkaye Dec 22, 2023
3d904b6
feat(sdks): pushing java code for deep
jonahkaye Dec 22, 2023
165e02d
feat(sdks): states lowercased in typescript
jonahkaye Dec 22, 2023
e3da22e
feat(sdks): typescript tests passing
jonahkaye Dec 22, 2023
c31a203
feat(sdks): merging to develop
jonahkaye Dec 22, 2023
5fad20a
feat(sdks): nits
jonahkaye Dec 22, 2023
7cb53c9
feat(sdks): scripts for easy running
jonahkaye Dec 22, 2023
6cbfb97
feat(sdks): fern gen in script
jonahkaye Dec 22, 2023
fb4ac8d
feat(sdks): rebasing
jonahkaye Dec 22, 2023
d532230
feat(sdks): webhook types
jonahkaye Jan 4, 2024
d134716
feat(sdks): validating first webhook def
jonahkaye Jan 4, 2024
3792b1a
feat(sdks): readme
jonahkaye Jan 4, 2024
6576526
feat(sdks): bundle extension deep pls take a look
jonahkaye Jan 4, 2024
13299bf
feat(sdks): resource not defined error
jonahkaye Jan 4, 2024
4e538e6
feat(sdk): debugging with deep and handoff
jonahkaye Jan 4, 2024
fa8e6ac
Revert "feat(sdk): debugging with deep and handoff"
jonahkaye Jan 10, 2024
e89bf68
feat(sdks): fixed node webhook types
jonahkaye Jan 10, 2024
92be8cd
Merge branch 'develop' into 1212-test-migration-python-sdk-tests
jonahkaye Jan 10, 2024
84b6d07
Merge branch 'develop' into 1212-test-migration-python-sdk-tests
jonahkaye Jan 14, 2024
99e288e
feat(sdks): pairing with ramil for his pr for fern
jonahkaye Jan 29, 2024
9f4a0ac
feat(sdks): merging develop to branch
jonahkaye Feb 7, 2024
ec5c1c4
feat(sdks): responding to nits
jonahkaye Feb 13, 2024
90dd1eb
Merge branch 'develop' into 1212-test-migration-python-sdk-tests
jonahkaye Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_snippets/patient.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

</ParamField>

<ParamField query="externalId" type="string">
<ParamField body="externalId" type="string">
An external Patient ID to associate to a Patient in Metriport.
</ParamField>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Returns the amount of resources for each resource type, for a given Patient.
The ID of the Patient.
</ParamField>

## Query Params

<ParamField query="resources" type="string" optional>
A comma separated, case sensitive list of resources to be counted. If none are provided all
resources will be included.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ api: "DELETE /medical/v1/patient/{id}"

## Query Params

<ParamField query="facilityId" type="string" required>
<ParamField query="facilityId" type="string" optional>
Copy link
Member Author

@jonahkaye jonahkaye Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified to match endpoint definition.

The ID of the Facility where the patient is receiving care.
</ParamField>

Expand Down
7 changes: 6 additions & 1 deletion fern/definition/commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ types:
type: string
docs: Zip must be a string consisting of 5 numbers.
country:
type: string
type: optional<string>
docs: Defaults to “USA”
examples:
- name: Example1
Expand Down Expand Up @@ -84,3 +84,8 @@ types:
- WV
- WI
- WY

Period:
properties:
start: optional<string>
end: optional<string>
123 changes: 103 additions & 20 deletions fern/definition/medical/document.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ../commons.yml

service:
base-path: /medical/v1/document
Expand Down Expand Up @@ -32,16 +34,22 @@ service:
facilityId:
docs: The ID of the Facility where the patient is receiving care.
type: string
body:
docs: |
Metadata holds a record of up to 50 custom string key-value pairs. Key names can be up to 40 characters long and values up to 500 characters long.
This metadata will be returned in the webhook response.
type: optional<map<string, string>>
response: DocumentQuery
examples:
- name: Example1
query-parameters:
patientId: "12345678"
facilityId: "12345678"
request: {"youCan": "putAny", "stringKeyValue": "pairsHere"}
response:
body: $DocumentQuery.Example1

getQueryStatus:
getQueryStatus:
display-name: Get Document Query Status
docs: |
Returns the document query status for the specified patient.
Expand Down Expand Up @@ -79,25 +87,19 @@ service:
patientId:
docs: The ID of the Patient for which to list available Documents.
type: string
facilityId:
docs: The ID of the Facility where the patient is receiving care.
type: string
dateFrom:
docs: The start date (inclusive) for which to filter returned documents - formatted `YYYY-MM-DD` as per ISO 8601. If not provided, no start date filter will be applied.
type: optional<string>
dateTo:
docs: The end date (inclusive) for which to filter returned documents - formatted `YYYY-MM-DD` as per ISO 8601. If not provided, no end date filter will be applied.
type: optional<string>
content:
docs: |
Value to search on the document reference (minimum 3 chars).
jonahkaye marked this conversation as resolved.
Show resolved Hide resolved
type: optional<string>
response:
type: ListDocumentsResponse
type: MedplumDocumentReference
docs: An array of objects describing the Documents that can be retrieved for the Patient.
examples:
- name: Example1
query-parameters:
patientId: "12345678"
facilityId: "12345678"
response:
body: $ListDocumentsResponse.Example1

getURL:
display-name: Get Document URL
Expand Down Expand Up @@ -129,12 +131,42 @@ service:
conversionType: "pdf"
response:
body: $DocumentUrl.Example1

createDocumentReference:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a missing endpoint I added

display-name: Upload Document
docs: |
Creates a DocumentReference and returns its ID and a URL to use for a medical document upload to our servers.
method: POST
path: /upload
request:
name: UploadDocumentRequest
query-parameters:
patientId:
docs: The ID of the Patient for which to list available Documents.
type: string
body:
docs: |
A FHIR DocumentReference.
type: UploadDocumentReference
response:
type: UploadDocumentResponse
docs: The DocumentReference ID and a URL to be used for file upload.
examples:
- name: Example1
query-parameters:
patientId: "12345678"
request: $UploadDocumentReference.Example1
response:
body: $UploadDocumentResponse.Example1

types:
DocumentQuery:
properties:
download: optional<Progress>
convert: optional<Progress>
requestId:
type: optional<string>
docs: The ID of the Document Query.
examples:
- name: Example1
value:
Expand Down Expand Up @@ -177,16 +209,11 @@ types:
- html
- pdf

ListDocumentsResponse:
MedplumDocumentReference:
properties:
documents: list<DocumentReference>
examples:
- name: Example1
value:
documents:
- $DocumentReference.Example1
documents: list<map<string, unknown>>

DocumentReference:
DocumentReferenceDocumentWebhook:
properties:
id:
type: string
Expand Down Expand Up @@ -265,6 +292,62 @@ types:
code: "62479008"
display: Diagnoses


UploadDocumentReference:
properties:
description:
type: string
docs: A brief description of the document - for example Discharge Summary
type:
type: CodeableConcept
docs: A CodeableConcept of the document type.
context:
type: list<DocumentReferenceContext>
docs: Context of the document content.
examples:
- name: Example1
value:
description: "Third degree wrist burn treatment"
type:
text: "Burn management Hospital Progress note"
coding:
- code: "100556-0"
system: "http://loinc.org"
display: "Burn management Hospital Progress note"
context: [$DocumentReferenceContext.Example1]


DocumentReferenceContext:
properties:
period:
type: optional<commons.Period>
docs: The time period over which the document was created.
facilityType:
type: optional<CodeableConcept>
docs: The kind of facility where the patient was seen.
examples:
- name: Example1
value:
period:
start: "2023-10-10T14:14:17Z"
end: "2023-10-10T15:30:30Z"
facilityType:
text: "John Snow Clinic - Acute Care Centre"

UploadDocumentResponse:
properties:
documentReferenceId:
type: string
docs: The ID of the DocumentReference.
uploadUrl:
type: string
docs: The URL to use for uploading the document.
examples:
- name: Example1
value:
documentReferenceId: "<DocumentReference-ID-string>"
uploadUrl: "<url-string>"

DocumentUrl:
docs: A json object containing the URL will be returned.
properties:
Expand Down
124 changes: 87 additions & 37 deletions fern/definition/medical/fhir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,90 @@ service:
audiences:
- public
endpoints:
startConsolidatedQuery:
display-name: Start Consolidated Data Query
docs: Trigger a consolidated data query for the given patient
method: POST
# startConsolidatedQuery:
# display-name: Start Consolidated Data Query
# docs: Trigger a consolidated data query for the given patient
# method: POST
# path: /patient/{id}/consolidated/query
# path-parameters:
# id:
# type: string
# docs: The ID of the Patient.
# request:
# name: GetPatientConsolidatedData
# query-parameters:
# resources:
# docs: |
# A comma separated, case sensitive list of resources to be returned.
# If none are provided all resources will be included.
# type: optional<string>
# dateFrom:
# docs: |
# The start date (inclusive) for which to filter returned resources -
# formatted `YYYY-MM-DD` as per ISO 8601. If not provided,
# no start date filter will be applied.
# type: optional<string>
# dateTo:
# docs: |
# The end date (inclusive) for which to filter returned resources -
# formatted `YYYY-MM-DD` as per ISO 8601. If not provided,
# no end date filter will be applied.
# type: optional<string>
# conversionType:
# docs: |
# The doc type to convert to. Either html or pdf.
# type: optional<string>
# body:
# docs: |
# Metadata holds a record of up to 50 custom string key-value pairs. Key names can be up to 40 characters long and values up to 500 characters long.
# This metadata will be returned in the webhook response.
# type: optional<map<string, string>>

# response:
# type: StartConsolidatedQueryResponse
# docs: Returns a Bundle that contains a property entry which is simply an array of FHIR resources.
# examples:
# - path-parameters:
# id: "12345678"
# response:
# body:
# status: processing

getConsolidatedQueryStatus:
display-name: Get Consolidated Data Query status
docs: Get the status of querying for patient's consolidated data.
method: GET
path: /patient/{id}/consolidated/query
path-parameters:
id:
type: string
docs: The ID of the Patient.
request:
name: GetPatientConsolidatedData
query-parameters:
resources:
docs: |
A comma separated, case sensitive list of resources to be returned.
If none are provided all resources will be included.
type: optional<string>
dateFrom:
docs: |
The start date (inclusive) for which to filter returned resources -
formatted `YYYY-MM-DD` as per ISO 8601. If not provided,
no start date filter will be applied.
type: optional<string>
dateTo:
docs: |
The end date (inclusive) for which to filter returned resources -
formatted `YYYY-MM-DD` as per ISO 8601. If not provided,
no end date filter will be applied.
type: optional<string>
docs: The ID of the Patient
response:
type: StartConsolidatedQueryResponse
docs: Returns a Bundle that contains a property entry which is simply an array of FHIR resources.
type: GetConsolidatedQueryStatusResponse
examples:
- path-parameters:
- name: Example1
path-parameters:
id: "12345678"
response:
body:
status: processing
body: $GetConsolidatedQueryStatusResponse.Example0

getConsolidatedQueryStatus:
display-name: Get Consolidated Data Query status
docs: Get the status of querying for patient's consolidated data.
method: GET
path: /patient/{id}/consolidated/query
createPatientConsolidated:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added missing endpoint

display-name: Create Patient's Consolidated Data
docs: Create Patient's Consolidated Data with a FHIR Bundle.
method: PUT
path: /patient/{id}/consolidated
path-parameters:
id:
type: string
docs: The ID of the Patient
response:
type: GetConsolidatedQueryStatusResponse
type: TransactionResponse
examples:
- name: Example1
path-parameters:
id: "12345678"
response:
body: $GetConsolidatedQueryStatusResponse.Example0
body: $TransactionResponse.Example0

countPatientData:
display-name: Count Patient Data
Expand Down Expand Up @@ -150,6 +178,28 @@ types:
no end date filter will be applied.
type: optional<string>

TransactionResponse:
properties:
resourceType:
type: string
docs: The type of the FHIR resource. For a transaction response, this is always "Bundle".
id:
type: string
docs: A unique identifier for this transaction response.
type:
type: string
docs: The type of the bundle, which is "transaction-response" in this case.
entry:
type: list<map<string, unknown>>
docs: An array of responses for each transaction in the bundle. Each entry can be any arbitrary JSON object.
examples:
- name: Example0
value:
resourceType: "Bundle"
id: "12345"
type: "transaction-response"
entry: [{ "resourceId": "abc123", "status": "created", "details": "Resource created successfully" }]

ResourcesSearchableByPatient:
enum:
- Account
Expand Down
Loading
Loading