def testGetAllENTSurgicalHistories(self): x = CreateClinic(host, port, token, "Ensenada", "02/05/2016", "02/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid1 = int(ret[1]["id"]) x = CreateClinic(host, port, token, "Ensenada", "05/05/2016", "05/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid2 = int(ret[1]["id"]) x = CreateClinic(host, port, token, "Ensenada", "08/05/2016", "08/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid3 = int(ret[1]["id"]) data = {} data["paternal_last"] = "3abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid1 = int(ret[1]["id"]) data = {} data["paternal_last"] = "1abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid2 = int(ret[1]["id"]) data = {} data["paternal_last"] = "2abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid3 = int(ret[1]["id"]) delids = [] x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid1) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid1) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid1) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid2) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid2) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid2) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid3) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid3) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid3) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = GetENTSurgicalHistory(host, port, token) x.setClinic(clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTSurgicalHistory(host, port, token) x.setClinic(clinicid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTSurgicalHistory(host, port, token) x.setClinic(clinicid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTSurgicalHistory(host, port, token) x.setPatient(patientid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTSurgicalHistory(host, port, token) x.setPatient(patientid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTSurgicalHistory(host, port, token) x.setPatient(patientid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) for x in delids: y = DeleteENTSurgicalHistory(host, port, token, x) ret = y.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTSurgicalHistory(host, port, token) x.setClinic(clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 404) rtcs = ret[1] self.assertTrue(len(rtcs) == 0) x = DeleteClinic(host, port, token, clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200)
def testGetAllENTExams(self): x = CreateClinic(host, port, token, "Ensenada", "02/05/2016", "02/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid1 = int(ret[1]["id"]) x = CreateClinic(host, port, token, "Ensenada", "05/05/2016", "05/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid2 = int(ret[1]["id"]) x = CreateClinic(host, port, token, "Ensenada", "08/05/2016", "08/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid3 = int(ret[1]["id"]) data = {} data["paternal_last"] = "3abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid1 = int(ret[1]["id"]) data = {} data["paternal_last"] = "1abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid2 = int(ret[1]["id"]) data = {} data["paternal_last"] = "2abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid3 = int(ret[1]["id"]) delids = [] x = CreateENTExam(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid1) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") x.setComment("A comment") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid1) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid1) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid2) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid2) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid2) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid1) x.setClinic(clinicid3) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid2) x.setClinic(clinicid3) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid3) x.setClinic(clinicid3) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) delids.append(ret[1]["id"]) x = GetENTExam(host, port, token) x.setClinic(clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTExam(host, port, token) x.setClinic(clinicid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTExam(host, port, token) x.setClinic(clinicid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTExam(host, port, token) x.setPatient(patientid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTExam(host, port, token) x.setPatient(patientid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) x = GetENTExam(host, port, token) x.setPatient(patientid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) rtcs = ret[1] self.assertTrue(len(rtcs) == 3) for x in delids: y = DeleteENTExam(host, port, token, x) ret = y.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTExam(host, port, token) x.setClinic(clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 404) rtcs = ret[1] self.assertTrue(len(rtcs) == 0) x = DeleteClinic(host, port, token, clinicid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid1) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid2) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid3) ret = x.send(timeout=30) self.assertEqual(ret[0], 200)
def testUpdateENTSurgicalHistory(self): x = CreateClinic(host, port, token, "Ensenada", "02/05/2016", "02/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid = int(ret[1]["id"]) data = {} data["paternal_last"] = "abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid = int(ret[1]["id"]) x = CreateENTSurgicalHistory(host, port, token) x.setPatient(patientid) x.setClinic(clinicid) x.setUsername("Gomez") x.setGranuloma("left") x.setGranulomaComment("granuloma") x.setTubes("left") x.setTubesComment("tubes") x.setTplasty("right") x.setTplastyComment("tplasty") x.setEua("both") x.setEuaComment("eua") x.setFb("none") x.setFbComment("fb") x.setMyringotomy("left") x.setMyringotomyComment("myring") x.setCerumen("right") x.setCerumenComment("cerumen") x.setSeptorhinoplasty(True) x.setSeptorhinoplastyComment("septo") x.setScarrevision(False) x.setScarrevisionComment("scar") x.setFrenulectomy(True) x.setFrenulectomyComment("fren") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) id = int(ret[1]["id"]) x = GetENTSurgicalHistory(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) x = UpdateENTSurgicalHistory(host, port, token, id) x.setFb("both") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTSurgicalHistory(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["fb"] == "both") x = UpdateENTSurgicalHistory(host, port, token, id) x.setFrenulectomy(False) x.setTubes("right") x.setEua("both") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setMyringotomy("zzz") ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setTubes(True) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setCerumenComment(14) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setFrenulectomy("none") ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setTplasty("both") x.setTubesComment(513) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTSurgicalHistory(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setScarrevision(True) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTSurgicalHistory(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["fb"] == "both") self.assertTrue(ret[1]["frenulectomy"] == False) self.assertTrue(ret[1]["tubes"] == "right") self.assertTrue(ret[1]["eua"] == "both") self.assertTrue(ret[1]["scarrevision"] == True) x = UpdateENTSurgicalHistory(host, port, token, id) x.setTplastyComment("a tplasty comment") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = UpdateENTSurgicalHistory(host, port, token, id) x.setCerumen("none") x.setFb("left") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTSurgicalHistory(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["fb"] == "left") self.assertTrue(ret[1]["frenulectomy"] == False) self.assertTrue(ret[1]["tubes"] == "right") self.assertTrue(ret[1]["eua"] == "both") self.assertTrue(ret[1]["cerumen"] == "none") self.assertTrue(ret[1]["scarrevision"] == True) self.assertTrue(ret[1]["tplastycomment"] == "a tplasty comment") x = DeleteENTSurgicalHistory(host, port, token, id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid) ret = x.send(timeout=30) self.assertEqual(ret[0], 200)
def testUpdateENTExam(self): x = CreateClinic(host, port, token, "Ensenada", "02/05/2016", "02/06/2016") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("id" in ret[1]) clinicid = int(ret[1]["id"]) data = {} data["paternal_last"] = "abcd1234" data["maternal_last"] = "yyyyyy" data["first"] = "zzzzzzz" data["middle"] = "" data["suffix"] = "Jr." data["prefix"] = "" data["dob"] = "04/01/1962" data["gender"] = "Female" data["street1"] = "1234 First Ave" data["street2"] = "" data["city"] = "Ensenada" data["colonia"] = "" data["state"] = u"Baja California" data["phone1"] = "1-111-111-1111" data["phone2"] = "" data["email"] = "*****@*****.**" data["emergencyfullname"] = "Maria Sanchez" data["emergencyphone"] = "1-222-222-2222" data["emergencyemail"] = "*****@*****.**" x = CreatePatient(host, port, token, data) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) patientid = int(ret[1]["id"]) x = CreateENTExam(host, port, token) x.setPatient(patientid) x.setClinic(clinicid) x.setNormal("left") x.setMicrotia("right") x.setWax("both") x.setDrainage("none") x.setExternalOtitis("left") x.setFb("none") x.setTubeLeft("in place") x.setTubeRight("extruding") x.setTympanoLeft("posterior") x.setTympanoRight("50 percent") x.setTmGranulations("left") x.setTmRetraction("right") x.setTmAtelectasis("both") x.setPerfLeft("posterior") x.setPerfRight("50 percent") x.setVoiceTest("normal") x.setForkAD("a greater b") x.setForkAS("a equal b") x.setBc("ad lat ad") x.setFork("512") x.setComment("A comment") x.setUsername("Gomez") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) id = int(ret[1]["id"]) x = GetENTExam(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) x = UpdateENTExam(host, port, token, id) x.setBc("ad lat as") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTExam(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["bc"] == "ad lat as") x = UpdateENTExam(host, port, token, id) x.setNormal("left") x.setForkAD("a greater b") x.setFork("512") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setPerfRight("zzz") ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setNormal(123) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setMicrotia(14) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setForkAD(999) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setPerfRight("total") x.setFork(513) ret = x.send(timeout=30) self.assertEqual(ret[0], 400) x = UpdateENTExam(host, port, token, id) x.setClinic(clinicid) x.setPatient(patientid) x.setPerfRight("total") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTExam(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["normal"] == "left") self.assertTrue(ret[1]["forkAD"] == "a greater b") self.assertTrue(ret[1]["fork"] == "512") self.assertTrue(ret[1]["perfRight"] == "total") x = UpdateENTExam(host, port, token, id) x.setVoiceTest("abnormal") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = UpdateENTExam(host, port, token, id) x.setTympanoRight("total") x.setTympanoLeft("25 percent") ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = GetENTExam(host, port, token) x.setId(id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) self.assertTrue("clinic" in ret[1]) clinicId = int(ret[1]["clinic"]) self.assertTrue(clinicId == clinicid) self.assertTrue("patient" in ret[1]) patientId = int(ret[1]["patient"]) self.assertTrue(patientId == patientid) self.assertTrue(ret[1]["normal"] == "left") self.assertTrue(ret[1]["forkAD"] == "a greater b") self.assertTrue(ret[1]["fork"] == "512") self.assertTrue(ret[1]["perfRight"] == "total") self.assertTrue(ret[1]["voiceTest"] == "abnormal") self.assertTrue(ret[1]["tympanoLeft"] == "25 percent") self.assertTrue(ret[1]["tympanoRight"] == "total") x = DeleteENTExam(host, port, token, id) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeleteClinic(host, port, token, clinicid) ret = x.send(timeout=30) self.assertEqual(ret[0], 200) x = DeletePatient(host, port, token, patientid) ret = x.send(timeout=30) self.assertEqual(ret[0], 200)