本文整理汇总了Java中ch.elexis.data.Artikel类的典型用法代码示例。如果您正苦于以下问题:Java Artikel类的具体用法?Java Artikel怎么用?Java Artikel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Artikel类属于ch.elexis.data包,在下文中一共展示了Artikel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addItemsToOrder
import ch.elexis.data.Artikel; //导入依赖的package包/类
public void addItemsToOrder(List<Artikel> articlesToOrder){
if (actBestellung == null) {
NeueBestellungDialog nbDlg = new NeueBestellungDialog(getViewSite().getShell(),
Messages.BestellView_CreateNewOrder, Messages.BestellView_EnterOrderTitle);
if (nbDlg.open() == Dialog.OK) {
setBestellung(new Bestellung(nbDlg.getTitle(), CoreHub.actUser));
} else {
return;
}
}
for (Artikel arti : articlesToOrder) {
// SINGLE SHOT ORDER
actBestellung.addBestellungEntry((Artikel) arti, null, null, 1);
}
if (tv != null && !tv.getControl().isDisposed()) {
tv.refresh();
}
}
示例2: doAddLine
import ch.elexis.data.Artikel; //导入依赖的package包/类
private void doAddLine(){
try {
LeistungenView lv1 =
(LeistungenView) getViewSite().getPage().showView(LeistungenView.ID);
CodeSelectorHandler.getInstance().setCodeSelectorTarget(dropTarget);
CTabItem[] tabItems = lv1.ctab.getItems();
for (CTabItem tab : tabItems) {
ICodeElement ics = (ICodeElement) tab.getData();
if (ics instanceof Artikel) {
lv1.ctab.setSelection(tab);
break;
}
}
} catch (PartInitException ex) {
ExHandler.handle(ex);
}
}
示例3: getFieldDefs
import ch.elexis.data.Artikel; //导入依赖的package包/类
static final public InputData[] getFieldDefs(final Shell shell){
InputData[] ret = new InputData[] {
new InputData(Messages.Artikeldetail_typ, Artikel.FLD_TYP, Typ.STRING, null),
new InputData(Messages.Artikeldetail_EAN, Artikel.FLD_EAN, Typ.STRING, null),
new InputData(Messages.Artikeldetail_Pharmacode, Artikel.FLD_EXTINFO, Typ.STRING,
"Pharmacode"), //$NON-NLS-2$
new InputData(Messages.Artikeldetail_Einkaufspreis, Artikel.FLD_EK_PREIS, Typ.CURRENCY,
null),
new InputData(Messages.Artikeldetail_Verkaufspreis, Artikel.FLD_VK_PREIS, Typ.CURRENCY,
null),
new InputData(Messages.Artikeldetail_verpackungseinheit, Artikel.FLD_EXTINFO, Typ.INT,
"VerpackungsEinheit"), //$NON-NLS-2$
new InputData(Messages.Artikeldetail_stueckProAbgabe, Artikel.FLD_EXTINFO, Typ.INT,
"Verkaufseinheit")
};
return ret;
}
示例4: getForeground
import ch.elexis.data.Artikel; //导入依赖的package包/类
/**
* Lagerartikel are shown in blue, articles that should be ordered are shown in red
*/
public Color getForeground(Object element, int columnIndex){
if (element instanceof Artikel) {
Artikel art = (Artikel) element;
Availability availability =
CoreHub.getStockService().getCumulatedAvailabilityForArticle(art);
if (availability != null) {
switch (availability) {
case CRITICAL_STOCK:
case OUT_OF_STOCK:
return UiDesk.getColor(UiDesk.COL_RED);
default:
return UiDesk.getColor(UiDesk.COL_BLUE);
}
}
}
return null;
}
示例5: getColumnText
import ch.elexis.data.Artikel; //导入依赖的package包/类
public String getColumnText(Object element, int columnIndex){
StockEntry se = (StockEntry) element;
Artikel article = se.getArticle();
switch (columnIndex) {
case 0:
return se.getStock().getCode();
case 1:
return (article != null) ? article.getPharmaCode() : "";
case 2:
return (article != null) ? article.getEAN() : "";
case 3:
return (article != null) ? article.getLabel() : "";
case 4:
return Integer.toString(se.getMinimumStock());
case 5:
return Integer.toString(se.getCurrentStock());
case 6:
return Integer.toString(se.getMaximumStock());
case 7:
return (se.getProvider() != null) ? se.getProvider().getLabel() : StringConstants.EMPTY;
default:
return StringConstants.EMPTY;
}
}
示例6: canEdit
import ch.elexis.data.Artikel; //导入依赖的package包/类
@Override
protected boolean canEdit(Object element){
Stock stock = (Stock) element;
Artikel art = (Artikel) wvArtikel.getValue();
if (stock == null || art == null || (stockEntries.get(stock) == null)) {
return false;
}
if ((CURR == editorFor || FRAC == editorFor) && stock.getDriverUuid().length() > 0) {
// the current stock and fraction count of a stock commissioning system
// must not be directly changed
return false;
}
return true;
}
示例7: setArticleToBind
import ch.elexis.data.Artikel; //导入依赖的package包/类
public void setArticleToBind(Artikel article, boolean lookup){
if (!isDisposed()) {
ArticleSignature signature = getSignature();
if (signature != null && signature.isPersistent()) {
signature.toDefault();
}
// update with new article signature
this.article = article;
if (lookup) {
ArticleDefaultSignature defSignature =
ArticleDefaultSignature.getDefaultsignatureForArticle(article);
if (defSignature != null) {
signatureItem.setValue(ArticleSignature.fromDefault(defSignature));
} else {
signatureItem.setValue(new ArticleSignature(article, null));
}
} else {
signatureItem.setValue(new ArticleSignature(article, null));
}
updateTargetNonDatabinding();
// update the toolbar
for (IContributionItem item : toolbarManager.getItems()) {
item.update();
}
}
}
示例8: asExporter
import ch.elexis.data.Artikel; //导入依赖的package包/类
public MedicationElement asExporter(XChangeExporter parent, Prescription pr){
asExporter(parent);
Artikel art = pr.getArtikel();
String begin = pr.getBeginDate();
String end = pr.getEndDate();
String dose = pr.getDosis();
String remark = pr.getBemerkung();
setAttribute(ATTRIB_BEGINDATE, XMLTool.dateToXmlDate(begin));
if (!StringTool.isNothing(end)) {
setAttribute(ATTRIB_ENDDATE, XMLTool.dateToXmlDate(end));
}
setAttribute(ATTRIB_FREQUENCY, dose);
setAttribute(ATTRIB_PRODUCT, art.getLabel());
setAttribute(ATTRIB_REMARK, remark);
add(new XidElement().asExporter(parent, art));
parent.getContainer().addChoice(this, pr.getLabel(), pr);
return this;
}
示例9: getArtikelstammItem
import ch.elexis.data.Artikel; //导入依赖的package包/类
private Optional<Artikel> getArtikelstammItem(Artikel dispensationArticle){
String gtin = dispensationArticle.getGTIN();
Optional<Artikel> ret = Optional.empty();
if (gtin != null && !gtin.isEmpty()) {
ret = loadArtikelWithGtin(gtin);
if (ret.isPresent()) {
return ret;
}
}
String pharma = dispensationArticle.getPharmaCode();
if (pharma != null && !pharma.isEmpty()) {
ret = loadArtikelWithPharma(pharma);
if (ret.isPresent()) {
return ret;
}
}
return ret;
}
示例10: execute
import ch.elexis.data.Artikel; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException{
IWorkbenchPage activePage =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
List<Artikel> articlesToOrder = getArticlesToOrder(
HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection());
if (articlesToOrder.isEmpty()) {
log.debug("Skip handler execution as no articles are selected to add to an order!");
return null;
}
// load BestellView and pass articles to order
try {
BestellView bestellView = (BestellView) activePage.showView(BestellView.ID);
if (bestellView != null) {
bestellView.addItemsToOrder(articlesToOrder);
} else {
log.error("Cant't load BestellView to add articles to order");
}
} catch (PartInitException e) {
log.error("Cant't load BestellView to add articles to order", e);
}
return null;
}
示例11: getArticlesToOrder
import ch.elexis.data.Artikel; //导入依赖的package包/类
/**
* Add articles from all the selected prescriptions to an arraylist
*
* @param selection
* from the current view
* @return a list of selected articles or an {@code EMPTY} list
*/
@SuppressWarnings("unchecked")
private List<Artikel> getArticlesToOrder(ISelection selection){
List<Artikel> articlesToOrder = new ArrayList<Artikel>();
if (selection == null || selection.isEmpty()) {
return articlesToOrder;
}
// add all selected articles to order list
IStructuredSelection structSelcection = (IStructuredSelection) selection;
List<MedicationTableViewerItem> mtvItems = structSelcection.toList();
for (MedicationTableViewerItem mtvItem : mtvItems) {
Prescription p = mtvItem.getPrescription();
if (p != null) {
Artikel arti = p.getArtikel();
if (arti != null) {
articlesToOrder.add(arti);
}
}
}
return articlesToOrder;
}
示例12: importImmunizations
import ch.elexis.data.Artikel; //导入依赖的package包/类
@Override
public void importImmunizations(Patient elexisPatient, List<Immunization> immunizations){
for (Immunization immunization : immunizations) {
Consumable consumable = immunization.getConsumable();
Code atcCode = consumable.getWhoAtcCode();
Identificator gtin = consumable.getManufacturedProductId();
Artikel article = resolveArticle(gtin, atcCode);
Author author = immunization.getAuthor();
if (article != null) {
new Vaccination(elexisPatient.getId(), article, immunization.getApplyDate(),
consumable.getLotNr(), ((author != null) ? author.getCompleteName() : ""));
} else {
logger.warn("Article [" + consumable.getTradeName() + "] not found GTIN ["
+ ((gtin != null) ? gtin.getExtension() : "") + "]");
new Vaccination(elexisPatient.getId(), "", consumable.getTradeName(),
((gtin != null) ? gtin.getExtension() : ""),
((atcCode != null) ? atcCode.getCode() : ""), immunization.getApplyDate(),
consumable.getLotNr(), ((author != null) ? author.getCompleteName() : ""));
}
}
}
示例13: MiGelArtikel
import ch.elexis.data.Artikel; //导入依赖的package包/类
public MiGelArtikel(String code, String text, String unit, Money price){
create(MIGEL_NAME + code); //$NON-NLS-1$
String shortname = StringTool.getFirstLine(text, 120, "[\\n\\r]");
Matcher matcher = pattern.matcher(shortname);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, matcher.group(1) + " " + matcher.group(2));
}
matcher.appendTail(sb);
shortname = sb.toString();
set(new String[] {
Artikel.FLD_NAME, Artikel.FLD_TYP, Artikel.FLD_SUB_ID, Artikel.FLD_KLASSE
}, new String[] {
shortname, MIGEL_NAME, code, MiGelArtikel.class.getName()
});
setExt("FullText", text); //$NON-NLS-1$
setExt("unit", unit == null ? "-" : unit); //$NON-NLS-1$ //$NON-NLS-2$
set("VK_Preis", price.getCentsAsString()); //$NON-NLS-1$
}
示例14: performVaccination
import ch.elexis.data.Artikel; //导入依赖的package包/类
private void performVaccination(String patientId, Artikel article){
UiDesk.asyncExec(new Runnable() {
@Override
public void run(){
Date d = new Date();
if (ApplyVaccinationHandler.inProgress()) {
d = ApplyVaccinationHandler.getKonsDate();
}
Mandant m = (Mandant) ElexisEventDispatcher.getSelected(Mandant.class);
ApplicationInputDialog aid =
new ApplicationInputDialog(UiDesk.getTopShell(), article);
aid.open();
String lotNo = aid.getLotNo();
String side = aid.getSide();
Vaccination vacc = new Vaccination(patientId, article, d, lotNo, m.storeToString());
if (side != null && !side.isEmpty()) {
vacc.setSide(side);
}
}
});
}
示例15: getForeground
import ch.elexis.data.Artikel; //导入依赖的package包/类
public Color getForeground(final Object element, final int columnIndex){
if (element instanceof Artikel) {
Artikel art = (Artikel) element;
Availability availability =
CoreHub.getStockService().getCumulatedAvailabilityForArticle(art);
if (availability != null) {
switch (availability) {
case CRITICAL_STOCK:
case OUT_OF_STOCK:
return UiDesk.getColor(UiDesk.COL_RED);
default:
return UiDesk.getColor(UiDesk.COL_BLUE);
}
}
}
return null;
}