def addcsv(self, ssn, pfile=None, getrow=None, slist=None): '''Add a list of problems to a patient's record (ignore Select List if present)''' prec = [1] if pfile is not None: preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key', getrow) for pitem in prec: self.VistA.wait('Problem List Mgt Menu') self.VistA.write('Patient Problem List') self.VistA.wait('PATIENT NAME') self.VistA.write(ssn) self.VistA.wait('Select Action') self.VistA.write('AD') self.VistA.wait('Clinic') self.VistA.write(prec[pitem]['clinic'].rstrip().lstrip()) if slist is not None: # if there is a SL, the skip it... self.VistA.wait('Select Item') self.VistA.write('AD') probID = [ prec[pitem]['icd'].rstrip().lstrip(), prec[pitem]['icd10'].rstrip().lstrip(), prec[pitem]['snomed'].rstrip().lstrip() ] valIndex = 0 while True: index = self.VistA.multiwait(['Ok', 'PROBLEM']) if index == 1: self.VistA.write(probID[valIndex]) valIndex += 1 elif index == 0: break else: self.VistA.write('?') self.VistA.write('Yes') # if self.acode is not None: # self.VistA.wait('//'); self.VistA.write('') self.VistA.wait('COMMENT') self.VistA.write(prec[pitem]['comment1'].rstrip().lstrip()) self.VistA.wait('ANOTHER COMMENT') self.VistA.write(prec[pitem]['comment2'].rstrip().lstrip()) self.VistA.wait('DATE OF ONSET') self.VistA.write(prec[pitem]['onsetdate'].rstrip().lstrip()) self.VistA.wait('STATUS') self.VistA.write(prec[pitem]['status'].rstrip().lstrip()) self.VistA.wait('hronic') self.VistA.write(prec[pitem]['acutechronic'].rstrip().lstrip()) rval = self.VistA.multiwait( ['service-connected condition', 'uit w/o saving']) if rval == 0: self.VistA.write(prec[pitem]['service'].rstrip().lstrip()) self.VistA.wait('uit w/o saving?') self.VistA.write('Save') elif rval == 1: self.VistA.write('Save') self.VistA.wait('PROBLEM') self.VistA.write('') self.VistA.wait('Select Action') self.VistA.write('QUIT') self.VistA.wait('Print a new problem list') self.VistA.write('N')
def patientaddallcsv(self, pfile): '''Add ALL patients from specified CSV ''' preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key') # pitem is the key - prec[pitem][prop] are various values for pitem in prec: self.VistA.wait('OPTION NAME'); self.VistA.write('Register a Patient') # CG: copied from patient add in OSEHRASetup - means can skip 1010 index = self.VistA.multiwait(['PATIENT NAME',"Select 1010 printer"]) if index == 1: self.VistA.write("NULL") self.VistA.wait('PATIENT NAME') self.VistA.write(prec[pitem]['fullname'].rstrip().lstrip()) self.VistA.wait('NEW PATIENT'); self.VistA.write('YES') self.VistA.wait('SEX'); self.VistA.write(prec[pitem]['sex'].rstrip().lstrip()) self.VistA.wait('DATE OF BIRTH'); self.VistA.write(prec[pitem]['dob'].rstrip().lstrip()) self.VistA.wait('SOCIAL SECURITY NUMBER'); self.VistA.write(pitem) self.VistA.wait('TYPE'); self.VistA.write(prec[pitem]['type'].rstrip().lstrip()) self.VistA.wait('PATIENT VETERAN'); self.VistA.write(prec[pitem]['veteran'].rstrip().lstrip()) self.VistA.wait('SERVICE CONNECTED'); self.VistA.write(prec[pitem]['service'].rstrip().lstrip()) self.VistA.wait('MULTIPLE BIRTH INDICATOR'); self.VistA.write(prec[pitem]['twin'].rstrip().lstrip()) if str(prec[pitem]['pdup'].rstrip().lstrip()) is '1': self.VistA.wait('as a new patient') self.VistA.write('Yes') self.VistA.wait('//'); self.VistA.write('^\r') self.VistA.wait('MAIDEN NAME'); self.VistA.write(prec[pitem]['maiden'].rstrip().lstrip()) self.VistA.wait('PLACE'); self.VistA.write(prec[pitem]['cityob'].rstrip().lstrip()) self.VistA.wait('PLACE'); self.VistA.write(prec[pitem]['stateob'].rstrip().lstrip()) self.VistA.wait(''); self.VistA.write('\r\r\r')
def patientaddcsv(self, ssn, pfile=None, getrow=None): '''Add a patient from a specified record of a specified CSV file''' prec = [1] if pfile is not None: preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key', getrow) for pitem in prec: self.VistA.wait('OPTION NAME'); self.VistA.write('Register a Patient') # CG: copied from patient add in OSEHRASetup - means can skip 1010 index = self.VistA.multiwait(['PATIENT NAME',"Select 1010 printer"]) if index == 1: self.VistA.write("NULL") self.VistA.wait('PATIENT NAME') self.VistA.write(prec[pitem]['fullname'].rstrip().lstrip()) self.VistA.wait('NEW PATIENT'); self.VistA.write('YES') self.VistA.wait('SEX'); self.VistA.write(prec[pitem]['sex'].rstrip().lstrip()) self.VistA.wait('DATE OF BIRTH'); self.VistA.write(prec[pitem]['dob'].rstrip().lstrip()) self.VistA.wait('SOCIAL SECURITY NUMBER'); self.VistA.write(ssn) self.VistA.wait('TYPE'); self.VistA.write(prec[pitem]['type'].rstrip().lstrip()) self.VistA.wait('PATIENT VETERAN'); self.VistA.write(prec[pitem]['veteran'].rstrip().lstrip()) self.VistA.wait('SERVICE CONNECTED'); self.VistA.write(prec[pitem]['service'].rstrip().lstrip()) self.VistA.wait('MULTIPLE BIRTH INDICATOR'); self.VistA.write(prec[pitem]['twin'].rstrip().lstrip()) self.VistA.wait('//'); self.VistA.write('^\r') self.VistA.wait('MAIDEN NAME'); self.VistA.write(prec[pitem]['maiden'].rstrip().lstrip()) self.VistA.wait('PLACE OF BIRTH'); self.VistA.write(prec[pitem]['cityob'].rstrip().lstrip()) self.VistA.wait('PLACE OF BIRTH'); self.VistA.write(prec[pitem]['stateob'].rstrip().lstrip()) self.VistA.wait(''); self.VistA.write('\r\r\r')
def patientaddallcsv(self, pfile): # Add ALL patients from CSV to VistA preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key') for pitem in prec: self.signon() self.VistA.wait('OPTION NAME') self.VistA.write('Register a Patient') self.VistA.wait('PATIENT NAME') self.VistA.write(prec[pitem]['fullname'].rstrip().lstrip()) self.VistA.wait('NEW PATIENT') self.VistA.write('YES') self.VistA.wait('SEX') self.VistA.write(prec[pitem]['sex'].rstrip().lstrip()) self.VistA.wait('DATE OF BIRTH') self.VistA.write(prec[pitem]['dob'].rstrip().lstrip()) self.VistA.wait('SOCIAL SECURITY NUMBER') self.VistA.write(pitem) self.VistA.wait('TYPE') self.VistA.write(prec[pitem]['type'].rstrip().lstrip()) self.VistA.wait('PATIENT VETERAN') self.VistA.write(prec[pitem]['veteran'].rstrip().lstrip()) self.VistA.wait('SERVICE CONNECTED') self.VistA.write(prec[pitem]['service'].rstrip().lstrip()) self.VistA.wait('MULTIPLE BIRTH INDICATOR') self.VistA.write(prec[pitem]['twin'].rstrip().lstrip()) if str(prec[pitem]['pdup'].rstrip().lstrip()) is '1': self.VistA.wait('as a new patient') self.VistA.write('Yes') self.VistA.wait('//') self.VistA.write('^\r') self.VistA.wait('MAIDEN NAME') self.VistA.write(prec[pitem]['maiden'].rstrip().lstrip()) self.VistA.wait('PLACE') self.VistA.write(prec[pitem]['cityob'].rstrip().lstrip()) self.VistA.wait('PLACE') self.VistA.write(prec[pitem]['stateob'].rstrip().lstrip()) self.VistA.wait('') self.VistA.write('\r\r\r')
def patientaddcsv(self, ssn, pfile=None, getrow=None): # Add one patient to VistA prec = [1] if pfile is not None: preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key', getrow) for pitem in prec: self.signon() self.VistA.wait('OPTION NAME') self.VistA.write('Register a Patient') self.VistA.wait('PATIENT NAME') self.VistA.write(prec[pitem]['fullname'].rstrip().lstrip()) self.VistA.wait('NEW PATIENT') self.VistA.write('YES') self.VistA.wait('SEX') self.VistA.write(prec[pitem]['sex'].rstrip().lstrip()) self.VistA.wait('DATE OF BIRTH') self.VistA.write(prec[pitem]['dob'].rstrip().lstrip()) self.VistA.wait('SOCIAL SECURITY NUMBER') self.VistA.write(ssn) self.VistA.wait('TYPE') self.VistA.write(prec[pitem]['type'].rstrip().lstrip()) self.VistA.wait('PATIENT VETERAN') self.VistA.write(prec[pitem]['veteran'].rstrip().lstrip()) self.VistA.wait('SERVICE CONNECTED') self.VistA.write(prec[pitem]['service'].rstrip().lstrip()) self.VistA.wait('MULTIPLE BIRTH INDICATOR') self.VistA.write(prec[pitem]['twin'].rstrip().lstrip()) self.VistA.wait('//') self.VistA.write('^\r') self.VistA.wait('MAIDEN NAME') self.VistA.write(prec[pitem]['maiden'].rstrip().lstrip()) self.VistA.wait('PLACE OF BIRTH') self.VistA.write(prec[pitem]['cityob'].rstrip().lstrip()) self.VistA.wait('PLACE OF BIRTH') self.VistA.write(prec[pitem]['stateob'].rstrip().lstrip()) self.VistA.wait('') self.VistA.write('\r\r\r')
def addPatient(VistA, pfile): '''Add ALL patients from specified CSV ''' preader = TestHelper.CSVFileReader() prec = preader.getfiledata(pfile, 'key') for pitem in prec: VistA.write('S DUZ=1 D ^XUP') VistA.wait('Select OPTION NAME') VistA.write('Core Applications\r') VistA.wait("Core Applications") VistA.write("ADT Manager Menu") index = VistA.multiwait(['to continue', 'Select ADT Manager Menu']) if index == 0: VistA.write('') VistA.wait('ADT Manager Menu') VistA.write("Registration Menu\r") VistA.wait("Registration Menu") VistA.write('Register a Patient') index = VistA.multiwait(['PATIENT NAME', "Select 1010 printer"]) if index == 1: VistA.write("NULL") VistA.wait('PATIENT NAME') VistA.write(prec[pitem]['fullname'].rstrip().lstrip()) index = VistA.multiwait(['ARE YOU ADDING', 'Enterprise Search']) VistA.write('Y') if index == 1: while True: index = VistA.multiwait([ 'FAMILY', 'GIVEN', 'MIDDLE NAME', 'PREFIX', 'SUFFIX', 'DEGREE', 'SOCIAL SECURITY', 'DATE OF BIRTH', 'SEX', 'MAIDEN NAME', 'CITY', 'STATE', 'MULTIPLE BIRTH', 'PHONE NUMBER', 'ARE YOU ADDING' ]) if index == 14: VistA.write('Y') break elif index == 6: VistA.write(pitem) elif index == 7: VistA.write(prec[pitem]['dob'].rstrip().lstrip()) elif index == 8: VistA.write(prec[pitem]['sex'].rstrip().lstrip()) else: VistA.write('') VistA.wait('to continue') VistA.write('') VistA.wait('MULTIPLE BIRTH INDICATOR') VistA.write('') VistA.wait('MAIDEN NAME:') VistA.write('') else: VistA.wait('SEX') VistA.write(prec[pitem]['sex'].rstrip().lstrip()) VistA.wait('DATE OF BIRTH') VistA.write(prec[pitem]['dob'].rstrip().lstrip()) VistA.wait('SOCIAL SECURITY NUMBER') VistA.write(pitem) VistA.wait('TYPE') VistA.write(prec[pitem]['type'].rstrip().lstrip()) VistA.wait('PATIENT VETERAN') VistA.write(prec[pitem]['veteran'].rstrip().lstrip()) VistA.wait('SERVICE CONNECTED') VistA.write(prec[pitem]['service'].rstrip().lstrip()) VistA.wait('MULTIPLE BIRTH INDICATOR') VistA.write(prec[pitem]['twin'].rstrip().lstrip()) index = VistA.multiwait(["Do you still", 'FAMILY']) if index == 0: VistA.write('Y') VistA.wait("FAMILY") VistA.write('^\r') VistA.wait('MAIDEN NAME:') VistA.write('') VistA.wait('[CITY]') VistA.write(prec[pitem]['cityob'].rstrip().lstrip()) VistA.wait('[STATE]') VistA.write(prec[pitem]['stateob'].rstrip().lstrip()) VistA.wait('ALIAS') VistA.write('') searchArray = ['exit:', VistA.prompt] if VistA.type == 'cache': searchArray.append(VistA.namespace) index = VistA.multiwait(searchArray) if index == 0: VistA.write('\r') VistA.wait('Patient Data') VistA.write('Y') VistA.wait('QUIT') VistA.write('4') VistA.wait('COUNTRY') VistA.write('') VistA.wait('STREET ADDRESS') VistA.write('834 Ocean Vista Avenue\r') VistA.wait('ZIP') VistA.write('90401') VistA.wait('CITY') VistA.write('1') VistA.wait('PHONE NUMBER') VistA.write('310-555-2233\r\r') VistA.wait('changes') VistA.write('Y\r') VistA.wait('QUIT') VistA.write('\r\r') VistA.wait('QUIT') VistA.write('1') VistA.wait('PRIMARY NOK') VistA.write('Carter,David J Sr') VistA.wait('RELATIONSHIP') VistA.write('FATHER') VistA.wait('ADDRESS') VistA.write('Y') VistA.wait('WORK PHONE') VistA.write('310-555-9876\r^') VistA.wait('condition') VistA.write('N') VistA.wait('today') VistA.write('Y') VistA.wait('Registration login') VistA.write('NOW') VistA.wait(PROMPT)