You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MockClient.graphql call is always returning a Structure Definition, even though I've pre-created the appropriate resources
QUERY =
`\
{
List(id: $ID) {
id
title
entry {
item {
resource {
...on ServiceRequest {
id,
orderDetail {
text
}
DiagnosticReportList(_reference: based_on) {
id
status
}
}
}
}
}
}
}
`
Test Setup:
const medplum = new MockClient();
ctx.client = medplum;
// Create Orders
// By default, use the fields from the HomerServiceRequest mock, but
// overwrite id, orderDetail, category, and identifier (barcodeId)
ctx.orders = Array.from({ length: 4 }, (_, i) => ({
...deepCopy(HomerServiceRequest),
id: `order${i}`,
orderDetail: [{ text: 'LAB_PROCESSED' }],
category: { text: 'Ro' },
identifier: [{ system: 'kit/barcodeId', value: `${i}` }],
}));
ctx.orders.forEach((e: ServiceRequest) => {
medplum.createResource(e);
});
const orderList: List = {
resourceType: 'List',
id: 'List-0',
status: 'current',
mode: 'working',
source: createReference(DrAliceSmith),
entry: ctx.orders.map((order: ServiceRequest) => {
return {
item: createReference(order),
};
}),
};
ctx.list = await medplum.createResource(orderList);
Return Value:
OrderList {
"StructureDefinitionList": [
{
"resourceType": "StructureDefinition",
"id": "DiagnosticReport",
"name": "DiagnosticReport",
"description": "The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.",
"type": "DiagnosticReport",
"snapshot": {
"element": [
{
"id": "DiagnosticReport",
"path": "DiagnosticReport",
"definition": "The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.",
"min": 0,
"max": "*"
},
{
"id": "DiagnosticReport.id",
"path": "DiagnosticReport.id",
"definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",
"min": 0,
"max": "1",
"type": [
{
"code": "http:https://hl7.org/fhirpath/System.String"
}
]
},
{
"id": "DiagnosticReport.meta",
"path": "DiagnosticReport.meta",
"definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.",
"min": 0,
"max": "1",
"type": [
{
"code": "Meta"
}
]
},
{
"id": "DiagnosticReport.implicitRules",
"path": "DiagnosticReport.implicitRules",
"definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.",
"min": 0,
"max": "1",
"type": [
{
"code": "uri"
}
]
},
The text was updated successfully, but these errors were encountered:
The MockClient.graphql call is always returning a Structure Definition, even though I've pre-created the appropriate resources
The text was updated successfully, but these errors were encountered: