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


Java Drug.getQuantity方法代码示例

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


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

示例1: setResultSpecialQuantityRepeat

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private static void setResultSpecialQuantityRepeat(RxPrescriptionData.Prescription rx, Drug d) {
	String qStr = d.getQuantity();
	Pattern p1 = Pattern.compile("\\d+");
	Matcher m1 = p1.matcher(qStr);
	if (m1.find()) {
		String qNum = qStr.substring(m1.start(), m1.end());
		rx.setQuantity(qNum);
		//get the quantity unit
		String qUnit = qStr.replace(qNum, "").trim();
		if (qUnit != null && qUnit.length() > 0) {
			MiscUtils.getLogger().debug("changing unitName in setResultSpecialQuantityRepeat ");
			rx.setUnitName(qUnit);
		}
	}
	rx.setUnitName(d.getUnitName());

	rx.setRepeat(d.getRepeat());
	rx.setSpecial(d.getSpecial());
	rx.setSpecial(trimSpecial(rx));
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:21,代码来源:RxUtil.java

示例2: getAsTransferObject

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
 * Converts from the Drug domain model object to a serializable Drug transfer object.
 *
 * @param loggedInInfo information for the logged in user (unused).
 * @param d            the Drug domain object to convert from.
 * @return a serializable transfer object that represents the Drug object
 * @throws ConversionException if the conversion fails.
 */
@Override
public DrugTo1 getAsTransferObject(LoggedInInfo loggedInInfo, Drug d) throws ConversionException {

    DrugTo1 t = new DrugTo1();

    // Copy over the fields from the Drug to the new transfer object.
    // This is not a one-to-one mapping, some transformation is
    // done on types.

    t.setDrugId(d.getId());
    t.setBrandName(d.getBrandName());
    t.setGenericName(d.getGenericName());
    t.setAtc(d.getAtc());
    t.setRegionalIdentifier(d.getRegionalIdentifier());
    t.setDemographicNo(d.getDemographicId());
    t.setProviderNo(Integer.parseInt(d.getProviderNo())); // Parse the providerNo string to an int.
    t.setTakeMin(d.getTakeMin());
    t.setTakeMax(d.getTakeMax());
    t.setRxDate(d.getRxDate());
    t.setEndDate(d.getEndDate());
    t.setFrequency(d.getFreqCode());
    t.setDuration(Integer.parseInt(d.getDuration()));   // Parse the duration string to an int.
    t.setDurationUnit(d.getDurUnit());
    t.setRoute(d.getRoute());
    t.setForm(d.getDrugForm());
    t.setPrn(d.isPrn());
    t.setMethod(d.getMethod());
    t.setRepeats(d.getRepeat());
    t.setInstructions(d.getSpecial());
    t.setPrn(d.isPrn());
    t.setNoSubstitutions(d.isNoSubs());
    t.setLongTerm(d.isLongTerm());
    t.setArchived(d.isArchived());
    t.setArchivedDate(d.getArchivedDate());
    t.setArchivedReason(d.getArchivedReason());
    t.setExternalProvider(d.getOutsideProviderName());
    t.setAdditionalInstructions(d.getSpecialInstruction());

    if(d.getQuantity() != null){
        t.setQuantity(Integer.parseInt(d.getQuantity()));
    }

    this.populateTo1Strength(t, d);


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

示例3: 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


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