Monday, 21 September 2015

Difference Between 837 Institutional and 837 Professional

837 Professional

Professional billing is responsible for the billing of claims generated for work performed by physicians, suppliers and other non-institutional providers for both outpatient and inpatient services. Professional charges are billed on a CMS-1500 form. The electronic version of the CMS-1500 is called the 837-P, the P standing for the professional format.

837 Institutional
Institutional billing is responsible for the billing of claims generated for work performed by hospitals and skilled nursing facilities. Institutional charges are billed on a UB-04.
And also Hospital Billing uses Revenue Codes.


Revenue Codes

Revenue codes are 3-digit numbers that are used on hospital bills to tell the insurance companies either where the patient was when they received treatment, or what type of item a patient might have received as a patient. A medical claim will not be paid if this is missing from a bill.

Revenue codes go along with procedure codes. When putting them in a charge master, you would add the correct revenue code to the CPT code you were going to use for a particular department. It's the use of revenue codes which allows hospitals to use the same CPT code in multiple departments because it will show which department the services were provided in.

An easy example to use here would be to match up CPT code 99282, which is for an emergency room visit of low to moderate severity, and revenue code 450, which stands for emergency room. In this case, revenue code 450 is the only code that could be used for this CPT code, thus making this one easy to code.

In short, Revenue Codes are descriptions and dollar amounts charged for hospital services provided to a patient.  The revenue code tells an insurance company whether the procedure was performed in the emergency room, operating room or another department.For example, stitches may be given to a patient in the emergency room, or in a completely different area of the hospital like the maternity ward.


837 Specification

Both sets of 837 specifications are same. The only differences would be claim specific data that pertains to a single transaction. All three transactions contain ISA, GS and ST segments but some data and qualifying codes are specific to the type of 837. Another way to quickly identify which type of 837 is being encountered is by the codes sent in the GS-08 or in the ST-03. Professionals use a 005010X222, Institutional uses a 005010X223 and Dental uses a 005010X224.


837 Institutional Transaction Sample

Data Element

Value

Subscriber:

Clark Kent

Subscriber Address:

123 Fake St.

Pittsburgh, PA 15123

Sex:

M

DOB:

May 3, 2006

Insurance ID#:

000000001-03

Payer ID #:

987654321

Patient:

Clark Kent

Primary Payer:

UPMC Health Plan

Submitter:

Line Medical Center

EDI #:

111111111

Receiver:

UPMC Health Plan

EDI #:

222222222

Billing Provider:

Line Medical Center

Provider #

111111111

Address:

123 Line Blvd.

Pittsburgh, PA 15123

Contact Person and Number

Dr. J, 412-454-1000

Attending Physician:

William J. Line, MD

Attending Physician NPI:

2222222222

UPIN #

P97777

Patient Account Number:

333333

Date of Admission:

04/17/2011

Place of Service:

Hospital

Occurrence Codes and Dates:

41 on 5/1/2010

27 on 7/15/2010

33 on 4/15/2010 C2 on 4/10/2010

Value Code

30

Value Amount

$20.

Condition Codes:

01

ICD-9 Procedure Code and Date:

449.1, 7/30/2010

Principal Diagnosis Code:

250.00

Secondary Diagnosis Codes:

789.01

Revenue Codes

0300 0320 0270

Services:

HC

Institutional Services Rendered:

81000 76092 J1120

Line Item Charge Amounts

$120. $50. $30.

Total Charges:

$200.

 

 

Example 837 Data String
The following transmission sample illustrates the file format used for an EDI transaction, which includes delimiters and data segment symbols. The sample includes the ISA (Interchange Control) and GS (Functional Group) portions of a transmission, and only one ST/SE segment. This sample contains a line break after each tilde to provide an easy illustration of where a new data segment begins.

ISA*00* *00* *ZZ*111111111 *33*7306849549*110418*1336*^*00501*000000312*1*P*:~
GS*HC*111111111*7306849549*20110418*1336*312005010X223~
ST*837*0034*005010X223A1~
BHT*0019*00*3920394930203*20100816*1615*CH~
NM1*41*2* LINE MEDICAL CENTER*****46*111111111~
PER*IC*DR. J*TE*4124541000~
NM1*40*2*UPMCHP*****46*222222222~
HL*1**20*1~
NM1*85*2* LINE MEDICAL CENTER*****XX*1111111111~
N3*123 LINE BLVD~
N4*PITTSBURGH*PA*15123~
REF*EI*111111111~
PER*IC*CLARK KENT*TE*00000000101*FX*6145551212~
HL*2*1*22*0~
SBR*P*18*XYZ1234567******BL~
NM1*IL*1*KENT*CLARK*S**MI*00000000101~
N3*123 FAKE ST~
N4*PITTSBURGH*PA*15123~
DMG*D8*19820503*M~
NM1*PR*2*UPMCHP*****PI*222222222~
CLM*333333 *200***13:A:1***A**Y*Y~
DTP*434*RD8*20110417-20110417~
CL1*1*9*01~
REF*F8*ASD0000123~
HI*BK:25000~
HI*BF:78901~
HI*BR:4491:D8:20100730~
HI*BH:41:D8:20100501*BH:27:D8:20100715*BH:33:D8:20100415*BH:C2:D8:20100410~
HI*BE:30:::20~
HI*BG:01~
NM1*71*1*LINE*WILLIAM*AL***34*2222222222~
REF*1G*P97777~
LX*1~
SV2*0300*HC:81000*120*UN*1~
DTP*472*D8*20100730~
LX*2~
SV2*0320*HC:76092*50*UN*1~
DTP*472*D8*20100730~
LX*3~
SV2*0270*HC:J1120*30*UN*1~
DTP*472*D8*20100730~
SE*41*0001~
GE*1*312~
IEA*1*000000312~

Monday, 17 August 2015

java - How do you upload a file to an FTP server?

import java.io.File;
import java.io.FileNotFoundException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.Selectors;
import org.apache.commons.vfs2.impl.StandardFileSystemManager;
import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder;

public void onUpload()
{
String hostName = "xxxxxxx";
String username = "xxxxxxx";
String password = "xxxxxxx";
String ftpfolder = "outbound";

String fileName ="YourLocalFileName";
String remoteFilePath = "/" + ftpfolder + "/" + fileName;
String localFilePath = "YourLocalFilePath";
File file = new File(localFilePath);
if (!file.exists())
throw new RuntimeException("Error. Local file not found");

StandardFileSystemManager manager = new StandardFileSystemManager();
try {
manager.init();

// Create local file object
FileObject localFile = manager.resolveFile(file.getAbsolutePath());

// Create SFTP options
FileSystemOptions opts = new FileSystemOptions();

// SSH Key checking
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(
opts, "no");
// Root directory set to user home
SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts,
false);

// Timeout is count by Milliseconds
SftpFileSystemConfigBuilder.getInstance().setTimeout(opts, 10000);

// Create remote file object
FileObject remoteFile = manager.resolveFile(
createConnectionString(hostName, username, password,
remoteFilePath), opts);

// Copy local file to sftp server
remoteFile.copyFrom(localFile, Selectors.SELECT_SELF);
System.out.println("Done");
} catch (Exception e) {
//Catch and Show the exception
} finally {
manager.close();
win.detach();
}
}


public static String createConnectionString(String hostName,
String username, String password, String remoteFilePath) {
return "sftp://" + username + ":" + password + "@" + hostName + "/"
+ remoteFilePath;
}

Maven artifacts for Apache VFS is a Virtual File System library.


<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.0</version>
</dependency>

Sunday, 16 August 2015

java calculate percentage from decimal values

public String getAgegt150Per() {
BigDecimal bd3 = agegt150.divide(this.totalPayment,
RoundingMode.HALF_UP);
Integer val = bd3.multiply(new BigDecimal(100)).intValue();
if (val.intValue() == 0)
return "";
else
return val.toString() + "%";
}

Tuesday, 30 June 2015

Understanding EDI 835 Electronic Remittance Advice



First Let us understand the Workflow

  1. Patient Calls / Walks to the Physician(or Doctor or Provider) office to fix an Appointment.

  2. On the Appointment day, patient checked In to the office and give all the demographics information(last name, first name, DOB, address,etc.) and insurance information;

  3. Doctor check the Patient Previous medical record and does the treatment to the patient for the current problem(or Disease);
  4. Each Disease represents by a Code. That code is called ICD. It is also called Dx Codes or Problems or ICD Codes or Diagnosis Codes; So for each patient visit, doctor choose the correct ICD Code;

  5. Each treatment represent a code and that code is called CPT. It is also called Procedure Codes; So for each patient visit, doctor choose the correct CPT Code;

  6. Once all the process are over, now patient leaves the doctor room. Now the doctor office to get paid for the service provided to the the patient;

  7. Since the patient has health insurance, so patient leaves(checked out) the clinic and ask the clinic to get money from the insurance company;

  8. Now the Billing department of the Clinic prepare the Bill(Claim) by entering all the necessary information. This process is called Charge entry or Charge Posting;

  9. Once the Claim is prepared and send to the Insurance company for payment; 

  10. Billing Department using the Practice Management System (PMS), send the claim via EDI File. The EDI Transaction used to create the claim in the Electronic format is EDI 837
    Refer the Following Link to understand more on EDI 837
    What is an EDI ?
    EDI 837 Health Care Claim

  11. Once the 837 EDI File is created, then it will be send to the Clearing House.

  12. Clearing House will validate the EDI File and send to the particular insurance company.

  13. Insurance Company Process the Claim and prepare the Check (Cheque) and Statement(This statement is called Explanation of Benefits OR Remittance Advisory (EOB)          
    Refer the following Link for EOB
    EOB - An explanation of benefits 

  14. Insurance company also generates the EDI 835 File using their System. EDI 835 is electronic version of EOB.
    The Electronic Remittance Advice (ERA), or 835, is the electronic transaction which provides claim payment information in the HIPAA mandated ACSX12 005010X221A1   Format. These files are used by practices, facilities, and billing companies to Auto Posting payments into their systems.
    Refer the following link for Sample

    EDI 835 Health Care Claim Payment/Advice:

  15. Once the Check, Statement (EOB) and ERA File are ready, then insurance company first send the ERA File and EOB to the clearing house.Second , insurance company  will send the Check and copy of the EOB to the billing provider address . Third for each patient in the statement, the copy of the EOB will be emailed.

  16. Now the Billing Team download the EOB and ERA from the clearing house. If the PMS system has Auto Posting Using ERA File, then they will download the EDI File and do auto posting. If there is no auto posting Module, then they will download the EOB PDF and apply posting manually.Remember, some time, ERA/EOB file will be reach the clearing house, even before the insurance company send the payment check to the doctor.


      Now let us understand the EDI 835 File.

    1.        Download the EDI File Here and Corresponding PDF Format here.

    2.       Open the 0000060267841_070209.txt in Notepadd ++

    3.          Replace as follows


      image

    4. The segment BPR Contains the Information about the Check No and Check Amount

      image

      image

      In this example, Check Amount is $ 4.


            5. The next NI PR contains the Payer Information

                image


                image

                

         6. The next CLP Contains the Claim Information and Claim Level Payment


                          image


                          a)  CLP01 Is the Key Field to Match with the System. The value(153 is this example) is the claim Number in the Provider System. This number is an echo back number from EDI 837 Submit Electronic Claims
                      b)  CLP02 is the Claim Status code which determines whether it is paid by primary or secondary, etc

                image


              The other information are

               image
      

            7.  Segment SVC Contains Line Item Information . This is main and important segment because it contains Line Item Payment, Copay, Coninsurance, etc


                 image


                 





Monday, 27 April 2015

ZK Charts Drill Down Example

Note: You need ZK EE License for this.

Video Demo


Maven

	<dependency>
<groupId>org.zkoss.chart</groupId>
<artifactId>zkcharts</artifactId>
<version>2.0.0</version>
</dependency>

The following code  is from my project. You can check  the code for details.



<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk>
<window id="chartReceiptdaily" height="100%"
contentStyle="overflow:auto;"
viewModel="@id('vm') @init('com.product.webapp.charts.ChartReceiptDailyVM')"
apply="org.zkoss.bind.BindComposer">
<panel id="panel" title="Filter" framable="true" border="normal"
collapsible="true" open="true">
<panelchildren>
<separator />
<vgrid>
<columns>
<column hflex="min"></column>
<column hflex="min"></column>
<column hflex="min"></column>
<column hflex="1"></column>
<column hflex="1"></column>
</columns>
<rows>
<row>
<hbox hflex="1">
<vlayout>
<flabel value="Month" />
<EnumDrpDown labelFormat="2"
showDesc="false" hflex="1" dropDownType="1" id="monthnames"
EnumType="monthnames" name="monthnames"
value="@bind(vm.billingCond.monthName)" />
</vlayout>
</hbox>
<vlayout>
<hbox>
<vlayout>
<flabel value="Year" />
<intbox format="####"
value="@bind(vm.billingCond.year)" maxlength="4"
placeholder="YYYY" />
</vlayout>
</hbox>
</vlayout>
<vlayout>
<flabel value="Location" />
<hbox>
<ftextbox hflex="1"
sclass="highlightText" ctrlKeys="#del"
onCtrlKey="@command('onClearLookupValues',type='location')"
onFocus="@command('onFocusLookupValues',target=self)"
onDoubleClick="@command('jumpToScreen',code=self.value,screenNum=101)"
value="@bind(vm.billingCond.locationCode)" name="location" />
<toolbarbutton
sclass="gridToolbarButton" image="/images/smallsearch.png"
onClick="@command('OnLookUp',type='location')" />
</hbox>
</vlayout>
<vlayout>
<dlabel></dlabel>
<fbutton label="Apply" id="search"
onClick="@command('onApplyCondition',action=1)">
</fbutton>
</vlayout>
</row>
</rows>
</vgrid>
<separator />
</panelchildren>
</panel>
<div visible="@bind(not vm.showTitle)">
<separator></separator>
<separator></separator>
<separator></separator>
</div>


<div id="divchart"></div>
<separator></separator>
<div align="center">
<flabel sclass="screenheaderlabel"
visible="@bind(not vm.showingDetail)"
value="Click on the Totals to view Summary by Receipt Payment Mode." />
<fbutton label="Go Back" visible="@bind(vm.showingDetail)"
onClick="@command('goBack')">
</fbutton>
<separator></separator>
</div>

<separator></separator>
<separator></separator>

<panel width="65%">
<panelchildren>
<separator></separator>
<listbox id="" mold="paging" sclass="mylist"
height="400px" selectedItem="@bind(vm.selectedData)"
model="@load(vm.dataList)">
<listhead sizable="true">
<listheader label="@bind(vm.colCaption)"
hflex="1" sort="auto(data)" />
<listheader label="Receipts" hflex="1"
sort="auto(count)" />
<listheader label="Billed Amount" hflex="1"
sort="auto(amount)" align="right" />
</listhead>
<template name="model" var="p1">
<listitem>
<listcell label="@load(p1.data)" />
<listcell label="@load(p1.count)" />
<listcell
label="@load(c:formatNumber(p1.amount, '#,###.00'))" />
</listitem>
</template>
<listfoot>
<listfooter>
<label value="Grand Total" />
</listfooter>

<listfooter>
<label value="@bind(vm.totalCount)" />
</listfooter>
<listfooter>
<label
value="@bind(c:formatNumber(vm.totalAmount, '#,###.00'))" />
</listfooter>
</listfoot>
</listbox>
</panelchildren>
</panel>
<separator></separator>
<separator></separator>
</window>
</zk>



ViewModel

package com.product.webapp.charts;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.AfterCompose;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ContextParam;
import org.zkoss.bind.annotation.ContextType;
import org.zkoss.bind.annotation.ExecutionArgParam;
import org.zkoss.chart.Chart;
import org.zkoss.chart.Charts;
import org.zkoss.chart.ChartsEvent;
import org.zkoss.chart.Tooltip;
import org.zkoss.chart.plotOptions.PiePlotOptions;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.CategoryModel;
import org.zkoss.zul.SimpleCategoryModel;
import org.zkoss.zul.SimpleSingleValueCategoryModel;
import org.zkoss.zul.Window;

@SuppressWarnings("unchecked")
public class ChartReceiptDailyVM extends BaseChartVM {

@Wire("#chartReceiptdaily")
private Window win;
private CategoryModel model;
private String theme;
private boolean showingDetail = false;
private String colCaption = "";

public String getColCaption() {
return colCaption;
}

public void setColCaption(String colCaption) {
this.colCaption = colCaption;
}

public boolean isShowingDetail() {
return showingDetail;
}

public void setShowingDetail(boolean showingDetail) {
this.showingDetail = showingDetail;
}

@AfterCompose
public void initSetup(@ContextParam(ContextType.VIEW) Component view,
@ExecutionArgParam("theme") String theme) {
Selectors.wireComponents(view, this, false);
super.initSetup(win);
this.theme = theme;
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
String[] monthName = { "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December" };
String month = monthName[now.get(Calendar.MONTH)];
billingCond.setYear(year);
billingCond.setMonthName(month);
onApplyCondition(0);
}

@Command
public void goBack() {
onApplyCondition(0);
}

@SuppressWarnings("rawtypes")
@Command
public void onApplyCondition(@BindingParam("action") Integer action) {
if (action == 1)
this.showTitle = false;
billingCond.setChargeSummaryType("ReceiptDaily");
billingCond.setDay(null);
showingDetail = false;
colCaption = "Day";
divchart.getChildren().clear();
chart = new Charts();
chart.setType("column");
chart.setParent(divchart);
chart.setTitle("Patient Receipts Daily Summary");
chart.setSubtitle("Click on the Totals to view Summary by Receipt Payment Mode");
chart.addEventListener("onPlotClick", new onPlotSelect());
List<Object> results = billingReportService
.getPatientReceiptSummary(billingCond);
if (results.size() == 0)
Clients.showNotification("No Data found for the given condition.",
Clients.NOTIFICATION_TYPE_INFO, null, "middle_center", 1100);

dataList = new ArrayList<ChartDataList>();
this.totalAmount = BigDecimal.ZERO;
model = new SimpleCategoryModel();
Integer week = 0;
BigDecimal amount = BigDecimal.ZERO;
Long noOfReceipts = (long) 0;
String data = "";
for (Iterator it = results.iterator(); it.hasNext();) {
Object[] row = (Object[]) it.next();
week = (Integer) row[0];
amount = (BigDecimal) row[1];
noOfReceipts = (Long) row[2];
data = "Day-" + week;
dataList.add(new ChartDataList(data, noOfReceipts, amount, null));
model.setValue("Practice", week, amount);
totalAmount = totalAmount.add(amount);
totalCount = totalCount + noOfReceipts;
}
chart.getXAxis().setMin(0);
chart.getXAxis().getTitle().setText("Day");

chart.getYAxis().setMin(0);
chart.getYAxis().getTitle().setText("Receipt Amount ");

Tooltip tooltip = chart.getTooltip();
tooltip.setHeaderFormat("<span style=\"font-size:10px\">{point.key}</span><table>");
tooltip.setPointFormat("<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>"
+ "<td style=\"padding:0\"><b> $ {point.y:.1f} </b></td></tr>");
tooltip.setFooterFormat("</table>");
tooltip.setShared(true);
tooltip.setUseHTML(true);
chart.getPlotOptions().getColumn().setPointPadding(0.2);
chart.getPlotOptions().getColumn().setBorderWidth(0);
chart.getLegend().setEnabled(false);
chart.setModel(model);
super.onSelectChartTheme(this.theme);
BindUtils.postNotifyChange(null, null, this, "*");
}

@SuppressWarnings("rawtypes")
class onPlotSelect implements org.zkoss.zk.ui.event.EventListener {
@Override
public void onEvent(Event event) throws Exception {
showPaymentDetails((Integer) ((ChartsEvent) event).getCategory());
}
}

@SuppressWarnings("rawtypes")
private void showPaymentDetails(Integer day) {
SimpleSingleValueCategoryModel model;
billingCond.setChargeSummaryType("paymentMode");
billingCond.setDay(day);
colCaption = "Mode";
showingDetail = true;
divchart.getChildren().clear();
chart = new Charts();
chart.setType("pie");
chart.setParent(divchart);
chart.setTitle("Receipt By Payment Mode");
List<Object> results = billingReportService
.getPatientReceiptSummary(billingCond);
dataList = new ArrayList<ChartDataList>();
this.totalAmount = BigDecimal.ZERO;
this.totalCount = 0L;
model = new SimpleSingleValueCategoryModel();
for (Iterator it = results.iterator(); it.hasNext();) {
Object[] row = (Object[]) it.next();
dataList.add(new ChartDataList((String) row[0], (Long) row[1],
(BigDecimal) row[2], (String) row[0]));
model.setValue((Comparable<?>) row[0], (Number) row[2]);
totalAmount = totalAmount.add((BigDecimal) row[2]);
totalCount = totalCount + (Long) row[1];
}
chart.setModel(model);
Chart chartOptional = chart.getChart();
chartOptional.setPlotBorderWidth(0);
chartOptional.setBackgroundColor("");
chart.getTooltip().setPointFormat(
"{series.name}: <b>{point.percentage:.1f}%</b>");
PiePlotOptions plotOptions = chart.getPlotOptions().getPie();
plotOptions.setAllowPointSelect(true);
plotOptions.setCursor("pointer");
plotOptions.getDataLabels().setEnabled(true);
plotOptions.setShowInLegend(true);
super.onSelectChartTheme(this.theme);
BindUtils.postNotifyChange(null, null, this, "*");
}
}


Java class to store the results



package com.product.webapp.charts;

import java.math.BigDecimal;

public class ChartDataList {

private String data;
private Long count;
private BigDecimal amount;
private String monthName;

public String getMonthName() {
return monthName;
}

public void setMonthName(String monthName) {
this.monthName = monthName;
}

public ChartDataList(String data, Long count, BigDecimal amount) {
this.data = data;
this.count = count;
this.amount = amount;
}

public ChartDataList(String data, Long count, BigDecimal amount,
String monthName) {
this.data = data;
this.count = count;
this.amount = amount;
this.monthName = monthName;
}

public String getData() {
return data;
}

public void setData(String data) {
this.data = data;
}

public Long getCount() {
return count;
}

public void setCount(Long count) {
this.count = count;
}

public BigDecimal getAmount() {
return amount;
}

public void setAmount(BigDecimal amount) {
this.amount = amount;
}

}

Thursday, 9 April 2015

Monday, 6 April 2015

ZK Search Text Box

ZK Version : 7.0.3

image

 

<?page title="Search" contentType="text/html;charset=UTF-8"?>
<zk>
<style src="css/search1.css" />
<window title="Search" border="normal">
<box orient="horizontal" sclass="searchform">
<textbox sclass="searchfield" />
<button label="Ok" sclass="myroundbtn" />
</box>
</window>
</zk>


CSS File

.searchform {
display: inline-block;
zoom: 1; /* ie7 hack for display:inline-block */
*display: inline;
border: solid 1px #d2d2d2;
padding: 3px 5px;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, .1);
-moz-box-shadow: 0 1px 0px rgba(0, 0, 0, .1);
box-shadow: 0 1px 0px rgba(0, 0, 0, .1);
background: #f1f1f1;
background: -webkit-gradient(linear, left top, left bottom, from(#fff),
to(#ededed));
background: -moz-linear-gradient(top, #fff, #ededed);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
endColorstr='#ededed'); /* ie7 */
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
endColorstr='#ededed'); /* ie8 */
}

.searchform .searchfield {
background: #fff;
padding: 6px 6px 6px 8px;
width: 202px;
border: solid 1px #bcbbbb;
outline: none;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
}

.myroundbtn.z-button{
padding: 5px 10px;
background: #2664cf;
font-family: Arial, sans-serif;
color: #ffffff;
text-align: center;
display: block;
cursor: pointer border: 1px solid #4cadfc;
border-radius: 14px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px background: -webkit-gradient(linear, left top, left bottom, from(#0a8ffe),
to(#2b5cc6));
background: -moz-linear-gradient(top, #0a8ffe, #2b5cc6);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0a8ffe',
endColorstr='#2b5cc6')
}






image

<?page title="Search" contentType="text/html;charset=UTF-8"?>
<zk>
<style src="css/search2.css" />
<window title="Search" border="normal">
<box orient="horizontal" sclass="searchform">
<textbox sclass="searchfield"
placeholder="Please type some text" />
<button label="Search" sclass="mybtn" />
</box>
</window>
</zk>


CSS File

.searchform {
background: #eaf8fc;
background-image: -moz-linear-gradient(#fff, #d4e8ec);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #d4e8ec),
color-stop(1, #fff));
-moz-border-radius: 35px;
border-radius: 35px;
border-width: 1px;
border-style: solid;
border-color: #c4d9df #a4c3ca #83afb7;
width: 500px;
height: 35px;
padding: 10px;
margin: 100px auto 50px;
overflow: hidden; /* Clear floats */
}

.searchform .searchfield {
padding: 5px 9px;
height: 23px;
width: 380px;
border: 1px solid #a4c3ca;
font: normal 13px 'trebuchet MS', arial, helvetica;
background: #f1f1f1;
-moz-border-radius: 50px 3px 3px 50px;
border-radius: 50px 3px 3px 50px;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset, 0 1px 0
rgba(255, 255, 255, 1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset, 0 1px 0
rgba(255, 255, 255, 1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) inset, 0 1px 0
rgba(255, 255, 255, 1);
}

.mybtn.z-button {
background-image: none;
background: #6cbb6b;
background-image: -moz-linear-gradient(#95d788, #6cbb6b);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #6cbb6b),
color-stop(1, #95d788));
-moz-border-radius: 3px 50px 50px 3px;
border-radius: 3px 50px 50px 3px;
border-width: 1px;
border-style: solid;
border-color: #7eba7c #578e57 #447d43;
-moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0
rgba(255, 255, 255, 0.3) inset;
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0
rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3)
inset;
height: 26px;
margin: 0 0 0 10px;
padding: 0;
width: 90px;
cursor: pointer;
font: bold 14px Arial, Helvetica;
color: #23441e;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
float: left;
padding-top: 1px;
}

.mybtn.z-button:hover {
background: #95d788;
background-image: -moz-linear-gradient(#6cbb6b, #95d788);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #95d788),
color-stop(1, #6cbb6b));
}

Tuesday, 31 March 2015

ZK 7 Project Start-up Kit – Dynamic Menu

Well, You have learned the basics of ZK Framework and now you are ready to go to develop a Complete commercial Application or Sample Application. But how to start ? You might be end with lot of questions such as “Is there any template available ?”, “any support available for the project template”?, etc.

Here it is. I have developed a small Project start up kit with the following features

1. Menus are Dynamic for N Level support. What does it mean ? Well, in the modern Web application, you might want to visible/invisible Menu by each users type (aka Dynamic Menu). This template has that option . All the Menu caption and levels are Stored in MySQL Database and after login , it will retrieve the menus assigned only for the user.

2. Apart from Menu, You might be interested in giving permission to add/delete/edit for CRUD Based screens. Using this template, you can also control by each user.

3. For all the CRUD Based screens, Export to Excel option template is provided.

4. Sample CRUD Screen are Provided to ready to start.

5. Integrated with Spring Security

6. Integrated with Spring Hibernate Security.

7. Base DAO and DAO implementation classes are provided.

8. Utilising ZK's MVVM databinding.

Version 2 also available. For more details, please check here

Apart from the above, the Most important option is “ Support!!!!!!!”. Users who buying this kit, unlimited support will be provided to help them to understand the structure. If you are interested in buying this start up kit, please email to me at
vbsenthilinnet@gmail.com

Project Screenshots

Login Screen

image

Landing Page with Dynamic Menus

image

Assigning Role Based Rights including CRUD Options

image

User Creation

image


Global Error Handler Includes MySQL Errors

image


Project Structure

image

Sample Code

<zk>
<window id="userslist" border="none"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('com.product.webapp.admin.UsersListVM')">
<separator />
<div width="96%">
<span width="100%">
<div sclass="screenheader">
<separator />
<label id="lcaption" sclass="screenheaderlabel"
value="Users List" />
</div>
</span>
<div id="buttonsDiv" sclass="screenheaderbuts">
<button label="Add New"
visible="@load(vm.menu.canAdd eq 1)"
onClick="@command('onAddNew')">
</button>
</div>
<div sclass="clearboth"></div>
<div sclass="sectionSeperator"></div>
</div>
<separator />
<separator />
<div width="96%" sclass="sectionpadding">
<label value="User Name" />
<space />
<textbox id="name" cols="30"
value="@bind(vm.dataFilter.name)" onChange="@command('doFilter')"
instant="true" maxlength="30" />
<space spacing="20px" />
<checkbox id="activechk" label="Show only active"
value="@bind(vm.dataFilter.showOnlyActive)"
checked="@bind(vm.dataFilter.showOnlyActive)"
onCheck="@command('doFilter')" />
<space spacing="20px" />
<image sclass="fImageExcel"
onClick="@command('onExcelExport')" />
<div sclass="floatright">
<paging id="pagenavi" pageSize="@load(vm.pageSize)"
sclass="floatright" pageIncrement="1" detailed="true">
</paging>
</div>
<div sclass="clearboth"></div>
</div>
<separator />
<panel width="95%" sclass="sectionpadding">
<panelchildren>
<listbox id="" mold="paging" paginal="${pagenavi}"
sclass="mylist" selectedItem="@bind(vm.selectedItem)"
model="@load(vm.dataSet)">
<listhead sizable="true">
<listheader label="User Name"
sortDirection="ascending" sort="auto(userName)" />
<listheader label="First Name"
sort="auto(firstName)" />
<listheader label="Last Name"
sort="auto(lastName)" />
<listheader label="Role"
sort="auto(p1.userRole.roleName)" />
<listheader label="Action" />
</listhead>
<template name="model" var="p1">
<listitem
sclass="@load(p1.active eq 0 ?'inactiveRecord':'')">
<listcell label="@load(p1.userName)"
onClick="@command('onlinkOpen',record=p1)"
sclass="highlightcell" />
<listcell label="@load(p1.firstName)" />
<listcell label="@load(p1.lastName)" />
<listcell
label="@load(p1.userRole.roleName)" />
<listcell>
<hbox spacing="20px">
<image sclass="fimageActive"
onClick="@command('onDeactivate')"
visible="@load( (vm.menu.canDelete eq 1) and (p1.active ==1) and (p1.system == 0 ))" />
<image sclass="fimageInactive"
onClick="@command('onActivate')"
visible="@load((vm.menu.canDelete eq 1) and (p1.active !=1) and (p1.system == 0 ))" />
<image sclass="fimageDelete"
visible="@load( (vm.menu.canDelete eq 1) and (p1.system eq 0))"
onClick="@command('onDelete')" />
<image sclass="fimageedit"
visible="@load( (vm.menu.canEdit eq 1 ) and p1.system eq 0)"
onClick="@command('onEdit')" />
</hbox>
</listcell>
</listitem>
</template>
</listbox>
</panelchildren>
</panel>
</window>
</zk>


Export to Excel

image


Menus are Dynamically Loaded from the MYSQL Table

image



To buy this start-up kit, please email me at vbsenthilinnet@gmail.com

Video Demo