def initData():
   """Load data and mappings from Raw data files and mapping files"""
   Patient.load()
   Med.load()
   Problem.load()
   Lab.load()
   Refill.load()
Exemple #2
0
def initData():
   """Load data and mappings from Raw data files and mapping files"""
   Patient.load()
   Med.load()
   Problem.load()
   Lab.load()
   Refill.load()
Exemple #3
0
def write_file(detector, file):
    """
    Writes Mca or Med objects to a disk file.

    Parameters:
    -----------
    * detector: An med or mca object
    * file: The name of the disk file to write.

    Example:
    --------
    >>write_file(mca,'mca.001')
    """
    # Make sure detector is type MED for simplicity...
    try:
        if detector.det_type != "MED":
            if has_attr(detector,'environment'):
                env = detector.environment
                del detector.environment
                #delattr(detector,'environment')
            else:
                env = None
            detector = Med(mca=[detector])
            if env: detector.environment = env
    except:
        return

    write_ascii_file(detector, file)
Exemple #4
0
def initData():
   """Load data and mappings from Raw data files and mapping files"""
   Patient.load()
   Med.load()
   Problem.load()
   Lab.load()
   Refill.load()
   VitalSigns.load()
   Immunization.load()
   Procedure.load()
   SocialHistory.load()
   FamilyHistory.load()
   Allergy.load()
Exemple #5
0
def initData():
    """Load data and mappings from Raw data files and mapping files"""
    Patient.load()
    Med.load()
    Problem.load()
    Lab.load()
    Refill.load()
    VitalSigns.load()
    Immunization.load()
    Procedure.load()
    SocialHistory.load()
    FamilyHistory.load()
    ClinicalNote.load()
    Allergy.load()
Exemple #6
0
def read_med(file,bad_mca_idx=[],total=True,align=True,correct=True,tau=None):
    """
    Reads a disk file into an Med object. The file contains the information
    from the Med object which makes sense to store permanently, but does
    not contain all of the internal state information for the Med.

    Parameters:
    -----------
    * file: The name of the disk file to read.

    Notes:
    ------
    * If the file includes "Environment data" these wil lbe included
      in the returned object as med.environment
    * If the file includes ROI's the will be included with the mca's
      in the returned object as med.mca[i].rois

    """
    # read the file
    r = read_ascii_file(file)
    if r == None: return None

    # some info
    n_detectors = r['n_detectors']
    path, fname = os.path.split(file)

    # check for boge detectors
    check_det = True
    if check_det == True:
        for j in range(n_detectors):
            if r['mca'][j].total_counts < 1.:
                if j not in bad_mca_idx:
                    bad_mca_idx.append(j)
        bad_mca_idx.sort()

    # build the med object
    med = Med(name=fname, mca=r['mca'], bad_mca_idx=bad_mca_idx,
              total=total, align=align, correct=correct, tau=tau)

    # below are set only if defined in file
    if r['max_rois'] > 0:
        rois = r['rois']
        for d in range(n_detectors):
            med.mca[d].rois = rois[d]
    if len(r['environment']) > 0:
        med.environment = r['environment']

    return med
Exemple #7
0
def initData():
    """Load data and mappings from Raw data files and mapping files"""
    Patient.load()
    VitalSigns.load()
    Lab.load()
    Procedure.load()
    Immunization.load()
    FamilyHistory.load()
    SocialHistory.load()
    Condition.load()
    Med.load()
    Refill.load()
    Document.load()
    Allergy.load()
    ClinicalNote.load()
    Practitioner.load()
    Coverage.load()
    ExplanationOfBenefit.load()
Exemple #8
0
def get_med_name(message):

    med = Med(message.text)
    chat_id = message.chat.id
    med_dict[chat_id] = med
    text = """Итак, %s, верно? Теперь введите количество препарата\
в одной упаковке (шт, мл)""" % med.name
    bot.send_message(message.from_user.id, text)
    bot.register_next_step_handler(message, get_value_in_full)