Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpeterkort committed Nov 19, 2024
1 parent 821431f commit a7f6fdd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions conformance/tests/ot_bulk_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def test_bulk_add_raw(man):
err = bulkRaw.execute()
if err["insertCount"] != 4:
errors.append(f"Wrong number of inserted vertices {err['insertCount']} != 4")
if err["errorCount"] != 0:
errors.append(f"Wrong number of errors {err['errorCount']} != 0")
if len(err["errors"]) != 0:
errors.append(f"Wrong number of errors {len(err['errors'])} != 0")

edge = G.getVertex("838e42fb-a65d-4039-9f83-59c37b1ae889")
if "gid" not in edge and edge["gid"] != "838e42fb-a65d-4039-9f83-59c37b1ae889":
Expand Down Expand Up @@ -49,8 +49,8 @@ def test_bulk_add_raw_validation_error(man):
bulkRaw.addJson(data={"resourceType":"Patient","id":"041095c0-41b7-4cad-be5d-5942f5e72331","meta":{"versionId":"1","lastUpdated":"2023-01-26T15:09:27.533+00:00","source":"#2bs0ExNirFINpsaq","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\">Generated by <a href=\"https://github.com/synthetichealth/synthea\">Synthea</a>.Version identifier: v2.6.1-174-g66c40fa7\n . Person seed: -5631757156564495430 Population seed: 1626964256551</div>"},"extension":[{"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-race","extension":[{"url":"ombCategory","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2106-3","display":"White"}},{"url":"text","valueString":"White"}]},{"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity","extension":[{"url":"ombCategory","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2186-5","display":"Non Hispanic or Latino"}},{"url":"text","valueString":"Non Hispanic or Latino"}]},{"url":"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName","valueString":"Johnie961 Howe413"},{"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex","valueCode":"M"},{"url":"http://hl7.org/fhir/StructureDefinition/patient-birthPlace","valueAddress":{"city":"Leominster","state":"Massachusetts","country":"US"}},{"url":"http://synthetichealth.github.io/synthea/disability-adjusted-life-years","valueDecimal":11.356925230821238},{"url":"http://synthetichealth.github.io/synthea/quality-adjusted-life-years","valueDecimal":84.64307476917877}],"ider":[{"system":"https://github.com/synthetichealth/synthea","value":"98a6c929-b2cb-9719-ba06-ae2d693d1964"},{"type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"MR","display":"Medical Record Number"}],"text":"Medical Record Number"},"system":"http://hospital.smarthealthit.org","value":"98a6c929-b2cb-9719-ba06-ae2d693d1964"},{"type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"SS","display":"Social Security Number"}],"text":"Social Security Number"},"system":"http://hl7.org/fhir/sid/us-ssn","value":"999-54-8135"},{"type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"DL","display":"Driver's License"}],"text":"Driver's License"},"system":"urn:oid:2.16.840.1.113883.4.3.25","value":"S99944955"},{"type":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","code":"PPN","display":"Passport Number"}],"text":"Passport Number"},"system":"http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber","value":"X88746034X"}],"name":[{"use":"official","family":"Schiller186","given":["Stewart672"],"prefix":["Mr."]}],"telecom":[{"system":"phone","value":"555-164-3643","use":"home"}],"gender":"male","birthDate":"1924-09-05","address":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/geolocation","extension":[{"url":"latitude","valueDecimal":42.251447299625795},{"url":"longitude","valueDecimal":-71.10142275622101}]}],"line":["955 Willms Manor"],"city":"Milton","state":"MA","country":"US"}],"maritalStatus":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-MaritalStatus","code":"M","display":"M"}],"text":"M"},"multipleBirthBoolean":False,"communication":[{"language":{"coding":[{"system":"urn:ietf:bcp:47","code":"en-US","display":"English"}],"text":"English"}}],"links":[]})

err = bulkRaw.execute()
if err['insertCount'] != 3 or err['errorCount'] != 1:
errors.append(f"validation error causes -1 insertCount +1 error: {err['insertCount']} != 3 or {err['errorCount']} != 1")
if err['insertCount'] != 3 or len(err['errors']) != 1:
errors.append(f"validation error causes -1 insertCount +1 error: {err['insertCount']} != 3 or {len(err['errors'])} != 1")

return errors

Expand All @@ -63,7 +63,7 @@ def test_bulk_add_raw_no_schema(man):
bulkRaw = G.bulkAddRaw()
bulkRaw.addJson(data={"category":[{"coding":[{"code":"encounter-diagnosis","display":"Encounter Diagnosis","system":"http://terminology.hl7.org/CodeSystem/condition-category"}]}],"clinicalStatus":{"coding":[{"code":"active","system":"http://terminology.hl7.org/CodeSystem/condition-clinical"}]},"code":{"coding":[{"code":"230690007","display":"Stroke","system":"http://snomed.info/sct"}],"text":"Stroke"},"encounter":{"reference":"Encounter/f78a1442-683a-4ea2-adca-161902be19cb"},"id":"838e42fb-a65d-4039-9f83-59c37b1ae889","links":[{"href":"Patient/45c11dad-2b38-4c8e-822e-7abff8a1ee1d","rel":"subject_Patient"}],"meta":{"lastUpdated":"2023-01-26T14:21:56.658+00:00","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"source":"#DmW9sueQ4yuQdyA9","versionId":"1"},"onsetDateTime":"2013-08-24T15:40:53-04:00","recordedDate":"2013-08-24T15:40:53-04:00","resourceType":"Condition","subject":{"reference":"Patient/45c11dad-2b38-4c8e-822e-7abff8a1ee1d"},"verificationStatus":{"coding":[{"code":"confirmed","system":"http://terminology.hl7.org/CodeSystem/condition-ver-status"}]}})
err = bulkRaw.execute()
if err["errorCount"] != 1:
if len(err["errors"]) != 1:
errors.append("No schema was provided so error count should equal 1")

return []

0 comments on commit a7f6fdd

Please sign in to comment.