예제 #1
0
    def testCreatePatientJSONResponse(self):
        GETRequest = http.createDefaultPatientGETRequest()
        LookupIds = {'_id': 'siimjoe'}
        GETRequest.setIdentifiersDict(LookupIds)
        response = GETRequest.executeRequest()
        JSONResponse = jsonResponse.createPatientJSONResponse(response)

        dict = {
            'siimjoe': {
                'given': 'Joe',
                'family': 'SIIM ',
                'address': '534 Erewhon St',
                'birthtime': '1926-03-30',
                'gender': 'male',
                'state': 'Vic',
                'city': 'PleasantVille',
                'postalcode': '3999'
            }
        }
        assert (JSONResponse.getPatientDictionaries() == dict)
        assert (JSONResponse.getNumberOfPatientEntries() == 1)
import DictionaryMatcher as match
import xml.etree.ElementTree as ET
import csv
import pandas as pd
import HTTPRequest as http
import CCDParser as parser
import PatientJSONResponse as jsonResponse
import logging
import pathlib
import fuzzywuzzy
from fuzzywuzzy import fuzz

GETRequest = http.createDefaultPatientGETRequest()
LookupIds = {'family': 'siim'}
GETRequest.setIdentifiersDict(LookupIds)
response = GETRequest.executeRequest()
JSONResponse = jsonResponse.createPatientJSONResponse(response)
SIIM = JSONResponse.getPatientDictionaries()

file_path = 'TestingSuite/TestFiles/IsabellaJones-ReferralSummary.xml'
isabellaDemographics = parser.createNewDemographicsInstance(file_path)
CCD = isabellaDemographics.getDemographicDict()

print(match.formatMatchDict(match.weightedPatientDictionaryMatch(CCD, SIIM)))
match.sortStringDict({
    'siimjoe': 35.125,
    'siimandy': 30.125,
    'siimneela': 48.125,
    'siimravi': 30.125,
    'siimsally': 33.5
})