Ejemplo n.º 1
0
def getFreeTextLink(dataEntry, value, **kargs):
    if value:
        if 'glbData' in kargs:
            glbData = kargs['glbData']
            # Acquire the field and file of the target information
            file, field = kargs["targetField"].split("/")
            # Check if the target file hasn't already been parsed
            if file not in glbData.outFileManData:
                glbData._glbData[file] = FileManFileData(
                    file, glbData.getFileManFileNameByFileNo(file))
                for pathName in glbData.allFiles[file]["path"]:
                    # Taken from the FileManGlobalDataParser
                    glbData._createDataRootByZWRFile(pathName)
                    glbLoc = glbData._glbLocMap.get(file)
                    for dataRoot in readGlobalNodeFromZWRFileV2(
                            pathName, glbLoc):
                        if not dataRoot:
                            continue
                        glbData._dataRoot = dataRoot
                        fileDataRoot = dataRoot
                        glbData._parseDataBySchema(
                            fileDataRoot, glbData._allSchemaDict[file],
                            glbData._glbData[file])
            # Once the information is available check for the target in any available
            # information in that file
            dataEntries = glbData.outFileManData[file].dataEntries
            for entry in dataEntries:
                if value == dataEntries[entry].fields[field].value:
                    return '<a href="%s/%s/%s-%s.html">%s</a>' % (
                        FILES_URL, dataEntries[entry].fileNo.replace(
                            ".", "_"), file, entry, value)
    return value
Ejemplo n.º 2
0
    def _generateServerMenu(self, allMenuList, allOptionList, serverMenuList):
        """
    Generates a virtual menu based upon content in serverMenuList
    All "SERVER" type options are sorted based upon value 12 or "Package"

    :param allMenuList: all available menus as dictionary
    :param allOptionList: all available options as dictionary
    :param serverMenuList: array of options that have "SERVER" type
    :return: None
    """
        # Add virtual menu for all "Server" type OPTIONS to be a child of
        menuArray = {}
        fileDataArray = {}
        menuArray['0'] = FileManDataEntry(19, "9999990")
        menuArray['0'].addField(
            FileManDataField('1', 4, 'MENU TEXT', 'Unknown'))
        menuArray['0'].addField(FileManDataField('4', 2, 'TYPE', 'menu'))
        menuArray['0'].type = 'menu'
        menuArray['0'].name = "19^9999990"
        fileDataArray['0'] = FileManFileData("9999990", 'TMP' + "1")

        serverMenuEntry = FileManDataEntry(19, "9999999")
        serverMenuEntry.name = "ZZSERVERMENU"
        serverMenuEntry.addField(FileManDataField('3.6', 0, 'CREATOR',
                                                  '200^1'))
        serverMenuEntry.addField(
            FileManDataField('1.1', 1, 'UPPERCASE MENU TEXT',
                             'SERVER VIRTUAL MENU'))
        serverMenuEntry.addField(FileManDataField('4', 2, 'TYPE', 'menu'))
        serverMenuEntry.addField(
            FileManDataField('1', 4, 'MENU TEXT', 'Server Virtual Menu'))
        serverMenuEntry.addField(
            FileManDataField('.01', 3, 'NAME', 'ZZSERVERMENU'))
        for menu in serverMenuList:
            if '12' in menu.fields:
                menuIEN = menu.fields['12'].value.split('^')[1]
                packageName = normalizePackageName(
                    self.dataMap.outFileManData['9.4'].dataEntries[menuIEN].
                    name)
                if menuIEN not in menuArray:
                    menuArray[menuIEN] = FileManDataEntry(
                        19, "999999" + menuIEN)
                    menuArray[menuIEN].addField(
                        FileManDataField('1', 4, 'MENU TEXT', packageName))
                    menuArray[menuIEN].addField(
                        FileManDataField('4', 2, 'TYPE', 'menu'))
                    menuArray[menuIEN].type = 'menu'
                    menuArray[menuIEN].name = "19^999999" + str(menuIEN)
                    fileDataArray[menuIEN] = FileManFileData(
                        "999999" + str(menuIEN), 'TMP' + "2")
            else:
                menuIEN = '0'
            tmp = FileManDataEntry(19, menu.ien)
            tmp.name = "19^" + menu.ien
            fileDataArray[menuIEN].addFileManDataEntry(
                len(fileDataArray[menuIEN].dataEntries), tmp)
            menuArray[menuIEN].addField(
                FileManDataField('10', 5, 'MENU', fileDataArray[menuIEN]))

        index = 1
        test = FileManFileData("9999999", 'Server Virtual Menu')
        for menu in menuArray:
            allOptionList.append(menuArray[menu])
            allMenuList.append(menuArray[menu])
            test.addFileManDataEntry(index, menuArray[menu])
            index += 1
        serverMenuEntry.addField(FileManDataField('10', 5, 'MENU', test))
        allMenuList.append(serverMenuEntry)
Ejemplo n.º 3
0
    def _generateServerMenu(self, allMenuList, allOptionList, serverMenuList):
        """
    Generates a virtual menu based upon content in serverMenuList
    All "SERVER" type options are sorted based upon value 12 or "Package"

    :param allMenuList: all available menus as dictionary
    :param allOptionList: all available options as dictionary
    :param serverMenuList: array of options that have "SERVER" type
    :return: None
    """
        # Add virtual menu for all "Server" type OPTIONS to be a child of
        menuArray = {}
        fileDataArray = {}
        package_name_dict = {
            "3": "Kernel",
            "4": "MailMan",
            "5": "Toolkit",
            "14": "Lab Service",
            "33": "Health Level Seven",
            "49": "Integrated Billing",
            "52": "IFCAP",
            "53": "Accounts Receivable",
            "73": "Network Health Exchange",
            "82": "CMOP",
            "85": "Patient Data Exchange",
            "93": "Automated Med Information Exchange",
            "99": "EEO Complaint Tracking",
            "114": "Fee Basis",
            "115": "Radiology/Nuclear Medicine",
            "124": "Medicine",
            "127": "Surgery",
            "128": "Oncology",
            "147": "Remote Order/Entry System",
            "149": "Voluntary Timekeepting",
            "165": "DSS Extracts",
            "181": "Enrollment Application System",
            "188": "Functional Independence",
            "201": "Health Data & Informatics"
        }
        menuArray['0'] = FileManDataEntry(19, "9999990")
        menuArray['0'].addField(
            FileManDataField('1', 4, 'MENU TEXT', 'Unknown'))
        menuArray['0'].addField(FileManDataField('4', 2, 'TYPE', 'menu'))
        menuArray['0'].type = 'menu'
        menuArray['0'].name = "19^9999990"
        fileDataArray['0'] = FileManFileData("9999990", 'TMP' + "1")

        serverMenuEntry = FileManDataEntry(19, "9999999")
        serverMenuEntry.name = "ZZSERVERMENU"
        serverMenuEntry.addField(FileManDataField('3.6', 0, 'CREATOR',
                                                  '200^1'))
        serverMenuEntry.addField(
            FileManDataField('1.1', 1, 'UPPERCASE MENU TEXT',
                             'SERVER VIRTUAL MENU'))
        serverMenuEntry.addField(FileManDataField('4', 2, 'TYPE', 'menu'))
        serverMenuEntry.addField(
            FileManDataField('1', 4, 'MENU TEXT', 'Server Virtual Menu'))
        serverMenuEntry.addField(
            FileManDataField('.01', 3, 'NAME', 'ZZSERVERMENU'))
        for menu in serverMenuList:
            if '12' in menu.fields:
                menuIEN = menu.fields['12'].value.split('^')[1]
                if menuIEN not in menuArray:
                    menuArray[menuIEN] = FileManDataEntry(
                        19, "999999" + menuIEN)
                    menuArray[menuIEN].addField(
                        FileManDataField('1', 4, 'MENU TEXT',
                                         package_name_dict[menuIEN]))
                    menuArray[menuIEN].addField(
                        FileManDataField('4', 2, 'TYPE', 'menu'))
                    menuArray[menuIEN].type = 'menu'
                    menuArray[menuIEN].name = "19^999999" + str(menuIEN)
                    fileDataArray[menuIEN] = FileManFileData(
                        "999999" + str(menuIEN), 'TMP' + "2")
            else:
                menuIEN = '0'
            tmp = FileManDataEntry(19, menu.ien)
            tmp.name = "19^" + menu.ien
            fileDataArray[menuIEN].addFileManDataEntry(
                len(fileDataArray[menuIEN].dataEntries), tmp)
            menuArray[menuIEN].addField(
                FileManDataField('10', 5, 'MENU', fileDataArray[menuIEN]))

        index = 1
        test = FileManFileData("9999999", 'Server Virtual Menu')
        for menu in menuArray.keys():
            allOptionList.append(menuArray[menu])
            allMenuList.append(menuArray[menu])
            test.addFileManDataEntry(index, menuArray[menu])
            index += 1
        serverMenuEntry.addField(FileManDataField('10', 5, 'MENU', test))
        allMenuList.append(serverMenuEntry)
Ejemplo n.º 4
0
  def _generateServerMenu(self, allMenuList, allOptionList, serverMenuList):
    """
    Generates a virtual menu based upon content in serverMenuList
    All "SERVER" type options are sorted based upon value 12 or "Package"

    :param allMenuList: all available menus as dictionary
    :param allOptionList: all available options as dictionary
    :param serverMenuList: array of options that have "SERVER" type
    :return: None
    """
    # Add virtual menu for all "Server" type OPTIONS to be a child of
    menuArray = {}
    fileDataArray = {}
    package_name_dict = {"3": "Kernel",
                         "4": "MailMan",
                         "5": "Toolkit",
                         "14": "Lab Service",
                         "33": "Health Level Seven",
                         "49": "Integrated Billing",
                         "52": "IFCAP",
                         "53": "Accounts Receivable",
                         "73": "Network Health Exchange",
                         "82": "CMOP",
                         "85": "Patient Data Exchange",
                         "93": "Automated Med Information Exchange",
                         "99": "EEO Complaint Tracking",
                         "114": "Fee Basis",
                         "115": "Radiology/Nuclear Medicine",
                         "124": "Medicine",
                         "127": "Surgery",
                         "128": "Oncology",
                         "147": "Remote Order/Entry System",
                         "149": "Voluntary Timekeepting",
                         "165": "DSS Extracts",
                         "181": "Enrollment Application System",
                         "188": "Functional Independence",
                         "201": "Health Data & Informatics"}
    menuArray['0'] = FileManDataEntry(19, "9999990")
    menuArray['0'].addField(FileManDataField('1', 4, 'MENU TEXT', 'Unknown'))
    menuArray['0'].addField(FileManDataField('4', 2, 'TYPE', 'menu'))
    menuArray['0'].type = 'menu'
    menuArray['0'].name = "19^9999990"
    fileDataArray['0'] = FileManFileData("9999990", 'TMP' + "1")

    serverMenuEntry = FileManDataEntry(19, "9999999")
    serverMenuEntry.name = "ZZSERVERMENU"
    serverMenuEntry.addField(FileManDataField('3.6', 0, 'CREATOR', '200^1'))
    serverMenuEntry.addField(FileManDataField('1.1', 1, 'UPPERCASE MENU TEXT', 'SERVER VIRTUAL MENU'))
    serverMenuEntry.addField(FileManDataField('4', 2, 'TYPE', 'menu'))
    serverMenuEntry.addField(FileManDataField('1', 4, 'MENU TEXT', 'Server Virtual Menu'))
    serverMenuEntry.addField(FileManDataField('.01', 3, 'NAME', 'ZZSERVERMENU'))
    for menu in serverMenuList:
      if '12' in menu.fields:
        menuIEN = menu.fields['12'].value.split('^')[1]
        if menuIEN not in menuArray:
          menuArray[menuIEN] = FileManDataEntry(19, "999999" + menuIEN)
          menuArray[menuIEN].addField(FileManDataField('1', 4, 'MENU TEXT', package_name_dict[menuIEN]))
          menuArray[menuIEN].addField(FileManDataField('4', 2, 'TYPE', 'menu'))
          menuArray[menuIEN].type = 'menu'
          menuArray[menuIEN].name = "19^999999" + str(menuIEN)
          fileDataArray[menuIEN]= FileManFileData("999999" + str(menuIEN), 'TMP' + "2")
      else:
        menuIEN = '0'
      tmp = FileManDataEntry(19, menu.ien)
      tmp.name = "19^" + menu.ien
      fileDataArray[menuIEN].addFileManDataEntry(len(fileDataArray[menuIEN].dataEntries), tmp)
      menuArray[menuIEN].addField(FileManDataField('10', 5, 'MENU', fileDataArray[menuIEN]))

    index = 1
    test = FileManFileData("9999999", 'Server Virtual Menu')
    for menu in menuArray.keys():
      allOptionList.append(menuArray[menu])
      allMenuList.append(menuArray[menu])
      test.addFileManDataEntry(index, menuArray[menu])
      index += 1
    serverMenuEntry.addField(FileManDataField('10', 5, 'MENU', test))
    allMenuList.append(serverMenuEntry)