Skip to content

Commit

Permalink
update tests and types
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Oct 18, 2023
1 parent 461dd21 commit 270a7c1
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 42 deletions.
34 changes: 17 additions & 17 deletions backend/src/main/resources/graphql/main.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type Facility {
isDeleted: Boolean
}

type FacilityStats{
usersSingleAccessCount:Int
type FacilityStats {
usersSingleAccessCount: Int
patientsSingleAccessCount: Int
}

Expand Down Expand Up @@ -80,6 +80,7 @@ input SupportedDiseaseTestPerformedInput {
supportedDisease: ID!
testPerformedLoincCode: String!
equipmentUid: String
equipmentUidType: String
testkitNameId: String
testOrderedLoincCode: String
}
Expand All @@ -98,6 +99,7 @@ type SupportedDiseaseTestPerformed {
supportedDisease: SupportedDisease!
testPerformedLoincCode: String!
equipmentUid: String
equipmentUidType: String
testkitNameId: String
testOrderedLoincCode: String
}
Expand Down Expand Up @@ -243,7 +245,7 @@ type Patient
preferredLanguage: String
@requiredPermissions(anyOf: ["READ_PATIENT_LIST", "UPDATE_TEST"])
notes: String
@requiredPermissions(anyOf: ["READ_PATIENT_LIST", "UPDATE_TEST"])
@requiredPermissions(anyOf: ["READ_PATIENT_LIST", "UPDATE_TEST"])
}

# TestResult and TestOrder should have the same properties
Expand Down Expand Up @@ -372,7 +374,7 @@ type UploadSubmissionPage {
content: [UploadResult!]!
}

type FeatureFlag{
type FeatureFlag {
name: String!
value: Boolean!
}
Expand Down Expand Up @@ -479,7 +481,8 @@ type Query {
users: [ApiUser] @requiredPermissions(allOf: ["MANAGE_USERS"])
usersWithStatus: [ApiUserWithStatus!]
@requiredPermissions(allOf: ["MANAGE_USERS"])
user(id: ID, email: String): User @requiredPermissions(allOf: ["MANAGE_USERS"])
user(id: ID, email: String): User
@requiredPermissions(allOf: ["MANAGE_USERS"])
whoami: User!
uploadSubmission(id: ID!): UploadResponse!
@requiredPermissions(allOf: ["UPLOAD_RESULTS_SPREADSHEET"])
Expand All @@ -493,15 +496,12 @@ type Query {
}

type Mutation {
updateFacility(
facilityInfo: UpdateFacilityInput!
): Facility @requiredPermissions(allOf: ["EDIT_FACILITY"])
addFacility(
facilityInfo: AddFacilityInput!
): Facility @requiredPermissions(allOf: ["EDIT_FACILITY"])
addUserToCurrentOrg(
userInput: UserInput!
): User @requiredPermissions(allOf: ["MANAGE_USERS"])
updateFacility(facilityInfo: UpdateFacilityInput!): Facility
@requiredPermissions(allOf: ["EDIT_FACILITY"])
addFacility(facilityInfo: AddFacilityInput!): Facility
@requiredPermissions(allOf: ["EDIT_FACILITY"])
addUserToCurrentOrg(userInput: UserInput!): User
@requiredPermissions(allOf: ["MANAGE_USERS"])
updateUser(
id: ID!
name: NameInput
Expand All @@ -525,7 +525,8 @@ type Mutation {
reactivateUser(id: ID!): User @requiredPermissions(allOf: ["MANAGE_USERS"])
resendActivationEmail(id: ID!): User
@requiredPermissions(allOf: ["MANAGE_USERS"])
reactivateUserAndResetPassword(id: ID!): User @requiredPermissions(allOf: ["MANAGE_USERS"])
reactivateUserAndResetPassword(id: ID!): User
@requiredPermissions(allOf: ["MANAGE_USERS"])
setCurrentUserTenantDataAccess(
organizationExternalId: String
justification: String
Expand Down Expand Up @@ -602,8 +603,7 @@ type Mutation {
id: ID!
deleted: Boolean!
orgExternalId: String
): Patient
@requiredPermissions(allOf: ["ARCHIVE_PATIENT"])
): Patient @requiredPermissions(allOf: ["ARCHIVE_PATIENT"])
submitQueueItem(
deviceTypeId: ID!
specimenTypeId: ID!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,22 @@ void convertToObservation_Result_matchesJson() throws IOException {
var device = DeviceType.builder().build();
var covidDiseaseTestPerformedCode =
new DeviceTypeDisease(
null, covidDisease, "94500-6", "covidEquipmentUID", "covidTestkitNameId", "94500-0");
null,
covidDisease,
"94500-6",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0");
var fluDiseaseTestPerformedCode =
new DeviceTypeDisease(
null, fluDisease, "85477-8", "fluEquipmentUID", "fluTestkitNameId", "85477-0");
null,
fluDisease,
"85477-8",
"fluEquipmentUID",
"fluEquipmentUidType",
"fluTestkitNameId",
"85477-0");
ReflectionTestUtils.setField(
device,
"supportedDiseaseTestPerformed",
Expand Down Expand Up @@ -910,7 +922,13 @@ void convertToObservation_Result_correctionMatchesJson() throws IOException {
var device = DeviceType.builder().build();
var covidDiseaseTestPerformedCode =
new DeviceTypeDisease(
null, covidDisease, "94500-6", "covidEquipmentUID", "covidTestkitNameId", "94500-0");
null,
covidDisease,
"94500-6",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0");

ReflectionTestUtils.setField(result, "internalId", UUID.fromString(id));
ReflectionTestUtils.setField(
Expand Down Expand Up @@ -1653,14 +1671,27 @@ void createFhirBundle_TestEvent_matchesJson() throws IOException {
var testPerformedCodesList =
List.of(
new DeviceTypeDisease(
deviceTypeId, covidDisease, "333-123", "equipmentUID1", "testkitNameId1", null),
deviceTypeId,
covidDisease,
"333-123",
"equipmentUID1",
"equipmentUIDType1",
"testkitNameId1",
null),
new DeviceTypeDisease(
deviceTypeId, fluADisease, "444-123", "equipmentUID2", "testkitNameId2", "95422-2"),
deviceTypeId,
fluADisease,
"444-123",
"equipmentUID2",
"equipmentUIDType2",
"testkitNameId2",
"95422-2"),
new DeviceTypeDisease(
deviceTypeId,
fluBDisease,
"444-456",
"equipmentUID3",
"equipmentUIDType3",
"testkitNameId3",
"95422-2"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void getSupportedDiseases_happyPath() {
UUID supportedDisease2Id = UUID.randomUUID();
String testPerformedLoinc = "test123PerformedLoinc";
String equipmentUid = "testEquipmentUid";
String equipmentUidType = "testEquipmentUidType";
String testkitNameId = "testkitNameId";
String testOrderedLoinc = "test123OrderedLoinc";

Expand All @@ -67,20 +68,23 @@ void getSupportedDiseases_happyPath() {
supportedDisease1,
testPerformedLoinc,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc),
new DeviceTypeDisease(
device2Id,
supportedDisease1,
testPerformedLoinc,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc),
new DeviceTypeDisease(
device2Id,
supportedDisease2,
testPerformedLoinc,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ private Map<String, Object> getCreateDeviceTypeInput() {
.supportedDisease(supportedDiseaseIds.get(0))
.testPerformedLoincCode("loinc1")
.equipmentUid("equipmentUid1")
.equipmentUidType("equipmentUid1Type")
.testkitNameId("testkitNameId1")
.testOrderedLoincCode("loinc3")
.build()))
Expand Down Expand Up @@ -155,6 +156,7 @@ private Map<String, Object> getUpdateDeviceTypeInput(UUID internalId) {
.supportedDisease(supportedDiseaseIds.get(0))
.testPerformedLoincCode("loinc1")
.equipmentUid("equipmentUid1")
.equipmentUidType("equipmentUidType1")
.testkitNameId("testkitNameId1")
.testOrderedLoincCode("loinc3")
.build()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,15 @@ void sendPatientInfoWithCommonDeviceDiseaseInfo() {
dataFactory.getCovidDisease(),
"94500-6",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId1",
"94500-0"),
new DeviceTypeDisease(
deviceType1.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId2",
"94500-0")));
dataFactory.addDiseasesToDevice(
Expand All @@ -290,13 +292,15 @@ void sendPatientInfoWithCommonDeviceDiseaseInfo() {
dataFactory.getCovidDisease(),
"94500-6",
"covidEquipmentUID1",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0"),
new DeviceTypeDisease(
deviceType2.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"covidEquipmentUID2",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0")));

Expand Down
Loading

0 comments on commit 270a7c1

Please sign in to comment.