当前位置: 首页>>代码示例>>Java>>正文


Java Drug.getBrandName方法代码示例

本文整理汇总了Java中org.oscarehr.common.model.Drug.getBrandName方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.getBrandName方法的具体用法?Java Drug.getBrandName怎么用?Java Drug.getBrandName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscarehr.common.model.Drug的用法示例。


在下文中一共展示了Drug.getBrandName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: populateDrug

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private void populateDrug(VisitData visitData, Drug drug) {
	Medication medication = visitData.addNewMedication();

	if(drug.getBrandName() != null && !drug.getBrandName().isEmpty()) {
		medication.setMedicationName(drug.getBrandName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		medication.setMedicationName(drug.getCustomName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		medication.setMedicationName(drug.getGenericName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		logger.warn("Could not find name for this drug! " + drug.getId());
	}
	
	if(drug.getRegionalIdentifier() != null && !drug.getRegionalIdentifier().isEmpty()) {
		try {
			medication.setMedicationDIN(drug.getRegionalIdentifier());
		} catch(NumberFormatException e) {
			logger.warn("regional identifier is not a number (id="+drug.getId()+")");
		}
	}
	
	if(drug.getRefillQuantity() != null) {
		medication.setMedicationNumberofRefills(drug.getRefillQuantity()+"");
	}
	/*
	medication.setMedicationDosage(arg0);
	medication.setMedicationDrugStrength(arg0);
	
	medication.setMedicationFrequency(arg0);
	*/
	medication.setMedicationStartDate(new XmlCalendar(dateFormatter.format(drug.getRxDate())));
	
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:40,代码来源:BORNWbCsdXmlGenerator.java

示例2: populateTo1Strength

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
 * Attempts to populate the strength and strength unit fields of the transfer object
 * based on the info in the drug object. Will not overwrite the strength fields if they
 * are already set.
 *
 * @param t a transfer object to populated.
 * @param d a drug object to use as a reference.
 *
 * @return true if populated successfully, false otherwise.
 */
protected Boolean populateTo1Strength(DrugTo1 t, Drug d) {

    if(t.getStrength() != null || (t.getStrengthUnit() != null && !t.getStrengthUnit().isEmpty())) {
        // check that the strength is not already set.
        return false;
    }

    if (d.getBrandName() == null || d.getBrandName().isEmpty()) return false;

    try {

        List<DrugSearchTo1> matchedDrugs = this.drugLookUpManager.search(d.getBrandName());
        DrugSearchTo1 details = null;

        if (matchedDrugs.size() >= 1) {

            // get the details for the drug in question
            details = this.drugLookUpManager.details(matchedDrugs.get(0).getId().toString());

            if(details != null){
                t.setStrength(details.getComponents().get(0).getStrength().floatValue());
                t.setStrengthUnit(details.getComponents().get(0).getUnit());
                return true;
            }else{
                return false;
            }

        } else {
            // if we did not find a matching drug ignore, not strength populated.
            return false;
        }
    } catch (Exception e) {
        return false;
    }

}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:47,代码来源:DrugConverter.java

示例3: getMeds

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public ActionForward getMeds(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)  throws IOException {
	Integer demographicNo = Integer.parseInt(request.getParameter("demographicNo"));
	DrugDao drugDao = SpringUtils.getBean(DrugDao.class);
	List<Drug> drugs = drugDao.findByDemographicId(demographicNo, false);
	StringBuilder output = new StringBuilder();
	for(Drug drug:drugs) {
		if(drug.isArchived() || drug.isDeleted() || drug.isDiscontinued() || drug.isExpired()) {
			continue;
		}
		if(drug.getBrandName() != null && drug.getBrandName().length()>0) {
			if(output.length()>0)
				output.append(",");
			output.append(drug.getBrandName());
		}
		else if(drug.getCustomName() != null && drug.getCustomName().length()>0) {
			if(output.length()>0)
				output.append(",");
			output.append(drug.getCustomName());
		} else {
			if(output.length()>0)
				output.append(",");
			output.append(drug.getSpecial());
		}
	}
	
	JSONObject json = JSONObject.fromObject(new LabelValueBean("meds",output.toString().trim()));
	response.getWriter().println(json);
	return null;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:30,代码来源:PregnancyAction.java

示例4: fillRxo

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private static void fillRxo(RXO rxo, Drug drug) throws HL7Exception {

		CWE drugType = rxo.getRequestedGiveCode();

		StringBuilder drugTypeSb = new StringBuilder();
		if (drug.getGenericName() != null) drugTypeSb.append(drug.getGenericName());
		if (drug.getBrandName() != null) {
			drugTypeSb.append('(');
			drugTypeSb.append(drug.getBrandName());
			drugTypeSb.append(')');
		}
		drugType.getText().setValue(drugTypeSb.toString());

		NM dosageMin = rxo.getRequestedGiveAmountMinimum();
		dosageMin.setValue(drug.getDosage());

		CWE dosageUnits = rxo.getRequestedGiveUnits();
		dosageUnits.getText().setValue(drug.getUnit());

		CWE dosageForm = rxo.getRequestedDosageForm();
		dosageForm.getText().setValue(drug.getDrugForm());

		CWE specialInstructions = rxo.getProviderSPharmacyTreatmentInstructions(0);
		specialInstructions.getText().setValue(drug.getSpecialInstruction());

		CWE administraionRouteMethod = rxo.getProviderSAdministrationInstructions(0);
		StringBuilder routeMethodSb = new StringBuilder();
		if (drug.getRoute() != null) routeMethodSb.append(drug.getRoute());
		if (drug.getMethod() != null) {
			if (routeMethodSb.length() > 0) routeMethodSb.append(", ");
			routeMethodSb.append(drug.getMethod());
		}
		administraionRouteMethod.getText().setValue(routeMethodSb.toString());

		rxo.getAllowSubstitutions().setValue(String.valueOf(!drug.isNoSubs()));
	}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:37,代码来源:OmpO09.java

示例5: addToFavorites

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public static boolean addToFavorites(String providerNo, String favoriteName, Drug drug) {
	Favorite fav = new Favorite(0, providerNo, favoriteName, drug.getBrandName(), drug.getGcnSeqNo(), drug.getCustomName(), drug.getTakeMin(), drug.getTakeMax(), drug.getFreqCode(), drug.getDuration(), drug.getDurUnit(), drug.getQuantity(), drug.getDispensingUnits(), drug.getRepeat(), drug.isNoSubs(), drug.isPrn(), drug.getSpecial(), drug.getGenericName(), drug.getAtc(), drug.getRegionalIdentifier(), drug.getUnit(), drug.getUnitName(), drug.getMethod(), drug.getRoute(), drug.getDrugForm(), drug.isCustomInstructions(),
	        drug.getDosage());
	fav.setDispenseInternal(drug.getDispenseInternal());
	return fav.Save();
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:7,代码来源:RxPrescriptionData.java

示例6: getDrugCode

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public static Code getDrugCode(Drug drug) {

        return new Code(drug.getAtc(), "2.16.840.1.113883.6.77", drug.getBrandName(), "ATC");
    }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:5,代码来源:MedicationUtil.java

示例7: getDrugDisplayData

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private static DrugDisplayData getDrugDisplayData(Drug drug) {
	DrugDisplayData drugDisplayData = new DrugDisplayData();

	drugDisplayData.localDrugId = drug.getId();

	RxProviderData.Provider prov = new RxProviderData().getProvider(drug.getProviderNo());
	drugDisplayData.providerName = prov.getFirstName() + ' ' + prov.getSurname();

	drugDisplayData.startDate = RxUtil.DateToString(drug.getRxDate());
	drugDisplayData.dateStartDate = drug.getRxDate();

	drugDisplayData.endDate = RxUtil.DateToString(drug.getEndDate());
	drugDisplayData.writtenDate = RxUtil.DateToString(drug.getWrittenDate());

	drugDisplayData.prescriptionDetails = RxPrescriptionData.getFullOutLine(drug.getSpecial()).replaceAll(";", " ");

               drugDisplayData.nonAuthoritative = drug.isNonAuthoritative();

	drugDisplayData.genericName = drug.getGenericName();

	drugDisplayData.customName = drug.getCustomName();

	drugDisplayData.brandName = drug.getBrandName();

	drugDisplayData.isArchived = drug.isArchived();
               
       drugDisplayData.pickupDate = RxUtil.DateToString(drug.getPickUpDateTime(),"yyyy-MM-dd");
               
       drugDisplayData.pickupTime = RxUtil.DateToString(drug.getPickUpDateTime(),"hh:mm aa");
       
       drugDisplayData.eTreatmentType = drug.getETreatmentType();

       drugDisplayData.rxStatus = drug.getRxStatus();
               
       drugDisplayData.dispenseInterval = drug.getDispenseInterval();
       
       drugDisplayData.refillDuration = drug.getRefillDuration();
       
       drugDisplayData.refillQuantity = drug.getRefillQuantity();
       
	return (drugDisplayData);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:43,代码来源:StaticScriptBean.java


注:本文中的org.oscarehr.common.model.Drug.getBrandName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。