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


Java Drug.setRxDate方法代码示例

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


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

示例1: getPrescriptDrug

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private Drug getPrescriptDrug(LoggedInInfo loggedInInfo,CachedDemographicDrug cachedDrug) throws MalformedURLException {
	Drug pd = new Drug();

	pd.setBrandName(cachedDrug.getBrandName());
	pd.setCustomName(cachedDrug.getCustomName());
	pd.setRxDate(DateUtils.toDate(cachedDrug.getRxDate()));
	pd.setArchived(cachedDrug.isArchived());
	pd.setSpecial(cachedDrug.getSpecial());
	pd.setEndDate(DateUtils.toDate(cachedDrug.getEndDate()));
	pd.setRegionalIdentifier(cachedDrug.getRegionalIdentifier());
	pd.setCreateDate(DateUtils.toDate(cachedDrug.getCreateDate()));

	pd.setId(cachedDrug.getFacilityIdIntegerCompositePk().getCaisiItemId());

	int remoteFacilityId = cachedDrug.getFacilityIdIntegerCompositePk().getIntegratorFacilityId();
	pd.setRemoteFacilityId(remoteFacilityId);

	CachedFacility cachedFacility = CaisiIntegratorManager.getRemoteFacility(loggedInInfo, loggedInInfo.getCurrentFacility(),remoteFacilityId);
	pd.setRemoteFacilityName(cachedFacility.getName());

	return (pd);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:23,代码来源:CaseManagementManager.java

示例2: getMedicationsOrderByDate

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
 * This method returns all the Drugs as a List associated with the
 * demographicId given, whether it's been archived or not, and in descending
 * order by rxDate.
 *
 * @param demographicId	Not Null
 * @param archived TRUE = not active, FALSE = active, null = all
 * @return
 */
public static List<Drug> getMedicationsOrderByDate(int demographicId, boolean archived) {
    //Gets the list of drugs
    List<Drug> drugList = getMedications(demographicId, archived);
    //Sorts the list of drugs by rxDate in descending order. 
    List<Drug> drugSortedList = new ArrayList<Drug>();
    for (int i = 0; i < drugList.size(); i++) {
        Drug toBeInserted = new Drug();
        toBeInserted.setRxDate(new Date(0));
        for (Drug aDrug : drugList) {
            if (aDrug.getRxDate().after(toBeInserted.getRxDate())) {
                toBeInserted = aDrug;
            }
        }
        drugSortedList.add(i, toBeInserted);
        drugList.remove(toBeInserted);
    }
    return drugSortedList;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:28,代码来源:MedicationUtil.java

示例3: getTestDrug

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

        Date startDate = new Date();
        Date endDate = new Date();
        Date archivedDate = new Date();

        Drug d = new Drug();

        d.setId(1);
        d.setDemographicId(1);
        d.setProviderNo("1");
        d.setBrandName("Foobar");
        d.setGenericName("Barbang");
        d.setRegionalIdentifier("12345");
        d.setAtc("abcde");
        d.setTakeMax(2);
        d.setTakeMin(1);
        d.setRxDate((Date) startDate.clone());
        d.setEndDate((Date) endDate.clone());
        d.setFreqCode("BID");
        d.setDuration("28");
        d.setDurUnit("D");
        d.setRoute("PO");
        d.setDrugForm("TAB");
        d.setPrn(true);
        d.setMethod("Take");
        d.setRepeat(5);
        d.setSpecial("some string");
        d.setArchived(false);
        d.setArchivedDate((Date) archivedDate.clone());
        d.setArchivedReason("reason");

        return d;

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

示例4: testCanPrescribeIsFalseOnBadDateSequence

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
@Test
public void testCanPrescribeIsFalseOnBadDateSequence(){
    Drug d = MockDrugDao.getTestDrug();

    // start after end date.
    d.setEndDate(new Date(100000000));
    d.setRxDate(new Date(200000000));

    assertFalse(canPrescribe(d));
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:11,代码来源:RxManagerTest.java

示例5: testInvalidDurationNumberStrings

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
@Test(expected = NumberFormatException.class)
public void testInvalidDurationNumberStrings() {
    Drug d = new Drug();

    LoggedInInfo info = new LoggedInInfo();

    Date startDate = new Date();
    Date endDate = new Date();
    Date archivedDate = new Date();

    // SHOULD CAUSE THE EXCEPTION
    d.setDuration("NOT A NUMBER");

    // Other fields
    d.setId(1);
    d.setDemographicId(1);
    d.setProviderNo("1");
    d.setBrandName("Foobar");
    d.setGenericName("Barbang");
    d.setRegionalIdentifier("12345");
    d.setAtc("abcde");
    d.setTakeMax(2);
    d.setTakeMin(1);
    d.setRxDate((Date) startDate.clone());
    d.setEndDate((Date) endDate.clone());
    d.setFreqCode("BID");
    d.setDurUnit("D");
    d.setRoute("PO");
    d.setDrugForm("TAB");
    d.setPrn(true);
    d.setMethod("Take");
    d.setRepeat(5);
    d.setSpecial("some string");
    d.setArchived(false);
    d.setArchivedDate((Date) archivedDate.clone());
    d.setArchivedReason("reason");

    DrugTo1 t = this.getAsTransferObject(info, d);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:40,代码来源:DrugConverterTest.java

示例6: testInvalidProviderNumberString

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
@Test(expected = NumberFormatException.class)
public void testInvalidProviderNumberString() {

    Drug d = new Drug();

    LoggedInInfo info = new LoggedInInfo();

    Date startDate = new Date();
    Date endDate = new Date();
    Date archivedDate = new Date();

    // SHOULD CAUSE THE EXCEPTION
    d.setProviderNo("NOT A NUMBER");

    // Other fields
    d.setId(1);
    d.setDemographicId(1);
    d.setBrandName("Foobar");
    d.setGenericName("Barbang");
    d.setRegionalIdentifier("12345");
    d.setAtc("abcde");
    d.setTakeMax(2);
    d.setTakeMin(1);
    d.setRxDate((Date) startDate.clone());
    d.setEndDate((Date) endDate.clone());
    d.setFreqCode("BID");
    d.setDuration("28");
    d.setDurUnit("D");
    d.setRoute("PO");
    d.setDrugForm("TAB");
    d.setPrn(true);
    d.setMethod("Take");
    d.setRepeat(5);
    d.setSpecial("some string");
    d.setArchived(false);
    d.setArchivedDate((Date) archivedDate.clone());
    d.setArchivedReason("reason");

    DrugTo1 t = this.getAsTransferObject(info, d);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:41,代码来源:DrugConverterTest.java

示例7: getTestDrug

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

        Date startDate = new Date();
        Date endDate = new Date();
        Date archivedDate = new Date();

        Drug d = new Drug();

        d.setId(1);
        d.setDemographicId(1);
        d.setProviderNo("1");
        d.setBrandName("Aspirin");
        d.setGenericName("ASA");
        d.setRegionalIdentifier("12345");
        d.setAtc("abcde");
        d.setTakeMax(2);
        d.setTakeMin(1);
        d.setRxDate((Date) startDate.clone());
        d.setEndDate((Date) endDate.clone());
        d.setFreqCode("BID");
        d.setDuration("28");
        d.setDurUnit("D");
        d.setRoute("PO");
        d.setDrugForm("TAB");
        d.setPrn(true);
        d.setMethod("Take");
        d.setRepeat(5);
        d.setSpecial("some string");
        d.setArchived(false);
        d.setArchivedDate((Date) archivedDate.clone());
        d.setArchivedReason("reason");

        return d;

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

示例8: getAsDomainObject

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
 * Converts from a transfer object to a Drug domain object.
 *
 * @param loggedInInfo information regarding the current logged in user.
 * @param t            the transfer object to copy the data from
 * @return a Drug domain object representing this data.
 * @throws ConversionException if conversion did not complete properly.
 */
@Override
public Drug getAsDomainObject(LoggedInInfo loggedInInfo, DrugTo1 t) throws ConversionException {

    Drug d = new Drug();

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

    try {

        d.setId(t.getDrugId());
        d.setBrandName(t.getBrandName());
        d.setGenericName(t.getGenericName());
        d.setDemographicId(t.getDemographicNo());
        d.setProviderNo(t.getProviderNo().toString()); // Cast to string.
        d.setAtc(t.getAtc());
        d.setRegionalIdentifier(t.getRegionalIdentifier());
        d.setDosage(t.getStrength() + t.getStrengthUnit());
        d.setTakeMax(t.getTakeMax());
        d.setTakeMin(t.getTakeMin());
        d.setRxDate(t.getRxDate());
        d.setEndDate(t.getEndDate());
        d.setFreqCode(t.getFrequency());
        d.setDuration(t.getDuration().toString()); // Cast to string.
        d.setDurUnit(t.getDurationUnit());
        d.setRepeat(t.getRepeats());
        d.setSpecial(t.getInstructions());
        d.setArchived(t.isArchived());
        d.setArchivedReason(t.getArchivedReason());
        d.setArchivedDate(t.getArchivedDate());
        d.setRoute(t.getRoute());
        d.setDrugForm(t.getForm());
        d.setMethod(t.getMethod());
        d.setPrn(t.isPrn());
        d.setLongTerm(t.getLongTerm());
        d.setNoSubs(t.getNoSubstitutions());
        d.setPosition(1);
        d.setOutsideProviderName(t.getExternalProvider());
        d.setSpecialInstruction(t.getAdditionalInstructions());

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


        populateDrugStrength(d, t);

    }catch(RuntimeException re){

        throw new ConversionException();

    }

    return d;

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

示例9: syncDrug

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private void syncDrug(Drug drug, Integer scriptId) {
	// the fields set are based on previous code, I don't know the details of why which are and are not set and can not audit it at this point in time.
	drug.setProviderNo(getProviderNo());
	drug.setDemographicId(getDemographicNo());
	drug.setRxDate(getRxDate());
	drug.setEndDate(getEndDate());
	drug.setWrittenDate(getWrittenDate());
	drug.setBrandName(getBrandName());
	drug.setGcnSeqNo(getGCN_SEQNO());
	drug.setCustomName(getCustomName());
	drug.setTakeMin(getTakeMin());
	drug.setTakeMax(getTakeMax());
	drug.setFreqCode(getFrequencyCode());
	drug.setDuration(getDuration());
	drug.setDurUnit(getDurationUnit());
	drug.setQuantity(getQuantity());
	drug.setDispensingUnits(getDispensingUnits());
	drug.setRepeat(getRepeat());
	drug.setLastRefillDate(getLastRefillDate());
	drug.setNoSubs(getNosubs());
	drug.setPrn(getPrn());
	drug.setSpecial(getSpecial());
	drug.setGenericName(getGenericName());
	drug.setScriptNo(scriptId);
	drug.setAtc(atcCode);
	drug.setRegionalIdentifier(regionalIdentifier);
	drug.setUnit(getUnit());
	drug.setMethod(getMethod());
	drug.setRoute(getRoute());
	drug.setDrugForm(getDrugForm());
	drug.setOutsideProviderName(getOutsideProviderName());
	drug.setOutsideProviderOhip(getOutsideProviderOhip());
	drug.setCustomInstructions(getCustomInstr());
	drug.setDosage(getDosage());
	drug.setUnitName(getUnitName());
	drug.setLongTerm(getLongTerm());
	drug.setCustomNote(isCustomNote());
	drug.setPastMed(getPastMed());
	drug.setDispenseInternal(getDispenseInternal());
	drug.setSpecialInstruction(getSpecialInstruction());
	drug.setPatientCompliance(getPatientCompliance());
	drug.setNonAuthoritative(isNonAuthoritative());
	drug.setPickUpDateTime(getPickupDate());
	drug.setETreatmentType(getETreatmentType());
	drug.setRxStatus(getRxStatus());
	drug.setDispenseInterval(getDispenseInterval());
	drug.setRefillQuantity(getRefillQuantity());
	drug.setRefillDuration(getRefillDuration());
	drug.setHideFromCpp(false);
	drug.setPosition(position);
	drug.setComment(getComment());
	drug.setStartDateUnknown(getStartDateUnknown());
	drug.setDispenseInternal(getDispenseInternal());
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:55,代码来源:RxPrescriptionData.java

示例10: testCanPrescribeIsFalseOnNullStartDate

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
@Test
public void testCanPrescribeIsFalseOnNullStartDate(){
    Drug d = MockDrugDao.getTestDrug();
    d.setRxDate(null);
    assertFalse(canPrescribe(d));
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:7,代码来源:RxManagerTest.java

示例11: testValidDomainToTransfer

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
@Test
public void testValidDomainToTransfer() throws Exception {

    Drug d = new Drug();

    LoggedInInfo info = new LoggedInInfo();

    Date startDate = new Date();
    Date endDate = new Date();
    Date archivedDate = new Date();

    d.setId(1);
    d.setDemographicId(1);
    d.setProviderNo("1");
    d.setBrandName("Foobar");
    d.setGenericName("Barbang");
    d.setRegionalIdentifier("12345");
    d.setAtc("abcde");
    d.setTakeMax(2);
    d.setTakeMin(1);
    d.setRxDate((Date) startDate.clone());
    d.setEndDate((Date) endDate.clone());
    d.setFreqCode("BID");
    d.setDuration("28");
    d.setDurUnit("D");
    d.setRoute("PO");
    d.setDrugForm("TAB");
    d.setPrn(true);
    d.setMethod("Take");
    d.setRepeat(5);
    d.setSpecial("some string");
    d.setArchived(false);
    d.setArchivedDate((Date) archivedDate.clone());
    d.setArchivedReason("reason");

    DrugTo1 t = this.getAsTransferObject(info, d);

    assertEquals(1, (int)t.getDrugId());
    assertEquals(1, (int) t.getDemographicNo());
    assertEquals(1, (int) t.getProviderNo());
    assertEquals("Foobar", t.getBrandName());
    assertEquals("Barbang", t.getGenericName());
    assertEquals("12345", t.getRegionalIdentifier());
    assertEquals("abcde", t.getAtc());
    assertEquals(1.0, t.getTakeMin(), 0.01);
    assertEquals(2.0, t.getTakeMax(), 0.01);
    assertEquals(startDate.toString(), t.getRxDate().toString());
    assertEquals(endDate.toString(), t.getEndDate().toString());
    assertEquals("BID", t.getFrequency());
    assertEquals(28, (int) t.getDuration());
    assertEquals("D", t.getDurationUnit());
    assertEquals("PO", t.getRoute());
    assertEquals("TAB", t.getForm());
    assertTrue(t.isPrn());
    assertEquals("Take", t.getMethod());
    assertEquals(5, (int) t.getRepeats());
    assertEquals("some string", t.getInstructions());
    assertEquals(archivedDate.toString(), t.getArchivedDate().toString());
    assertEquals("reason", t.getArchivedReason());
    assertFalse(t.isArchived());

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

示例12: getDrug

import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
Drug getDrug(String providerNo,	Integer demographicId, Date rxDate,Date endDate,Date writtenDate,String brandName,int gcnSeqNo,	String customName,float takeMin,float takeMax,String freqCode,
	String duration,String durUnit,String quantity,	Integer repeat,	boolean noSubs,	boolean prn,String special,String special_instruction,String genericName,String atc,Integer scriptNo,String regionalIdentifier,
	String unit,String method,String route,String drugForm,	Date createDate,String dosage,boolean customInstructions,String unitName,Boolean longTerm,Boolean pastMed,	Boolean patientCompliance,String outsideProviderName,
	String outsideProviderOhip ,Boolean hideFromDrugProfile,   Boolean customNote){

    Drug drug = new Drug();
	drug.setProviderNo(providerNo);
	drug.setDemographicId(demographicId);
	drug.setRxDate(rxDate);
	drug.setEndDate(endDate);
	drug.setWrittenDate(writtenDate);
	drug.setBrandName(brandName);
	drug.setGcnSeqNo(gcnSeqNo);
	drug.setCustomName(customName);
	drug.setTakeMin(takeMin);
	drug.setTakeMax(takeMax);
	drug.setFreqCode(freqCode);
	drug.setDuration(duration);
	drug.setDurUnit(durUnit);
	drug.setQuantity(quantity);
	drug.setRepeat(repeat);
	drug.setNoSubs(noSubs);
	drug.setPrn(prn);
	drug.setSpecial(special);
	drug.setSpecialInstruction(special_instruction);
	drug.setGenericName(genericName);
	drug.setAtc(atc);
	drug.setScriptNo(scriptNo);
	drug.setRegionalIdentifier(regionalIdentifier);
	drug.setUnit(unit);
	drug.setMethod(method);
	drug.setRoute(route);
	drug.setDrugForm(drugForm);
	drug.setCreateDate(createDate);
	drug.setDosage(dosage);
	drug.setCustomInstructions(customInstructions);
	drug.setUnitName(unitName);
	drug.setLongTerm(longTerm);
	drug.setPastMed(pastMed);
	drug.setPatientCompliance(patientCompliance);
	drug.setOutsideProviderName(outsideProviderName);
	drug.setOutsideProviderOhip(outsideProviderOhip);
	drug.setHideFromDrugProfile(hideFromDrugProfile);
	drug.setCustomNote(customNote);
	drug.setPosition(0);
	return drug;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:48,代码来源:OntarioMDSpec4DataTest.java


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