Requirement Constraints

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 6 July 2012

ZK Hibernate one to one annotation mapping bidirectional CRUD example using MVVM

Posted on 10:36 by Unknown

In this post, we will see how we can implement hibernate one to one mapping bidirectional using ZK Components

In bi-directional mapping, the parent table can be retrieved by the child table and the child table can be retrieved by the parent table. Means retrieval can be done in both direction or bi-directional. In this example, we have two tables caller persona and users. We will create CRUD operation for users which also takes care of inserting record in the person tabke.

ZK Version 6
Project Name : HibernateOneToOneMap
Project Structure

image

Step 1:  ZK + Hibernate Setup
Please
follow this post to setup the Project and related jar files needed for this example

Mysql

image

CREATE  TABLE IF NOT EXISTS `sampledb`.`person` (
  `ID` BIGINT(20) NOT NULL AUTO_INCREMENT ,
  `FirstName` VARCHAR(100) NULL DEFAULT NULL ,
  `LastName` VARCHAR(100) NULL DEFAULT NULL ,
  `Email` VARCHAR(100) NULL DEFAULT NULL ,
  PRIMARY KEY (`ID`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1

CREATE  TABLE IF NOT EXISTS `sampledb`.`userlogin` (
  `ID` BIGINT(20) NOT NULL AUTO_INCREMENT ,
  `LoginID` VARCHAR(100) NULL DEFAULT NULL ,
  `Password` VARCHAR(100) NULL DEFAULT NULL ,
  `PersonID` BIGINT(20) NULL DEFAULT NULL ,
  PRIMARY KEY (`ID`) ,
  INDEX `FK_userlogin` (`PersonID` ASC) ,
  CONSTRAINT `FK_userlogin`
    FOREIGN KEY (`PersonID` )
    REFERENCES `sampledb`.`person` (`ID` ))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1

person.java

package domain;

import javax.persistence.Column;
import javax.persistence.OneToOne;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;


@Entity
@Table(name = "person")
public class person {

@Id
@GeneratedValue
private int ID;

@Column(name = "FirstName")
private String FirstName;

@Column(name = "LastName")
private String LastName;

@Column(name = "Email")
private String Email;

@OneToOne(mappedBy = "person")
@Cascade(CascadeType.ALL)
private userlogin userlogin;


public userlogin getUserlogin() {
return userlogin;
}

public void setUserlogin(userlogin userlogin) {
this.userlogin = userlogin;
}

public int getID() {
return ID;
}

public void setID(int iD) {
ID = iD;
}

public String getFirstName() {
return FirstName;
}

public void setFirstName(String firstName) {
FirstName = firstName;
}

public String getLastName() {
return LastName;
}

public void setLastName(String lastName) {
LastName = lastName;
}

public String getEmail() {
return Email;
}

public void setEmail(String email) {
Email = email;
}

}

userlogin.java


package domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@Table(name = "userlogin")
public class userlogin implements Serializable, Cloneable {

@Id
@GeneratedValue
private int ID;

@Column(name = "LoginID")
private String LoginID;

@Column(name = "Password")
private String Password;


@OneToOne(targetEntity = person.class)
@Cascade(CascadeType.ALL)
@JoinColumn(name = "personid")
private person person;


public person getPerson() {
return person;
}

public void setPerson(person person) {
this.person = person;
}

public int getID() {
return ID;
}

public void setID(int iD) {
ID = iD;
}

public String getLoginID() {
return LoginID;
}

public void setLoginID(String loginID) {
LoginID = loginID;
}

public String getPassword() {
return Password;
}

public void setPassword(String password) {
Password = password;
}




public Object clone() throws CloneNotSupportedException {
/*
* Employee copyObj = new Employee();
* copyObj.setDesignation(this.designation); copyObj.setName(this.name);
* return copyObj;
*/
return super.clone();
}

}

HibernateUtil.java

package HibernateUtilities;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;

public class HibernateUtil {

private static SessionFactory factory;
private static ServiceRegistry serviceRegistry;

public static Configuration getInitConfiguration() {
Configuration config = new Configuration();
config.configure();
return config;
}

public static Session getSession() {
if (factory == null) {
Configuration config = HibernateUtil.getInitConfiguration();
serviceRegistry = new ServiceRegistryBuilder().applySettings(
config.getProperties()).buildServiceRegistry();
factory = config.buildSessionFactory(serviceRegistry);
}
Session hibernateSession = factory.getCurrentSession();
return hibernateSession;
}

public static Session beginTransaction() {
Session hibernateSession;
hibernateSession = HibernateUtil.getSession();
hibernateSession.beginTransaction();
return hibernateSession;
}

public static void CommitTransaction() {
HibernateUtil.getSession().getTransaction().commit();
}

public static void closeSession() {
HibernateUtil.getSession().close();
}

public static void rollbackTransaction() {
HibernateUtil.getSession().getTransaction().rollback();
}

}

 

hibernate.cfg.xml



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/sampledb</property>
<property name="connection.username">root</property>
<property name="connection.password">123</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>

<!-- Mapping Classes -->
<mapping class="domain.person" />
<mapping class="domain.userlogin" />

</session-factory>
</hibernate-configuration>



UserCRUDVM.java


package domainVM;

import java.util.HashMap;
import java.util.Map;

import domain.person;
import domain.userlogin;

import org.zkoss.bind.BindUtils;
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.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Window;

import DAO.userDAO;

public class UserCRUDVM {

private userlogin selectedItem;
private userlogin selectedItemOrg;
private boolean makeAsReadOnly;

@Wire("#win")
private Window win;

public boolean isMakeAsReadOnly() {
return makeAsReadOnly;
}

public void setMakeAsReadOnly(boolean makeAsReadOnly) {
this.makeAsReadOnly = makeAsReadOnly;
}


public userlogin getSelectedItem() {
return selectedItem;
}

public void setSelectedItem(userlogin s1) {
this.selectedItem = s1;
}

@Init
@NotifyChange("selectedItem")
public void initSetup(@ContextParam(ContextType.VIEW) Component view,
@ExecutionArgParam("selectedItem") userlogin s1,
@ExecutionArgParam("recordMode") String recordMode)
throws CloneNotSupportedException {
Selectors.wireComponents(view, this, false);


if (recordMode == "NEW") {
this.selectedItem = new userlogin();
this.selectedItemOrg = new userlogin();
this.selectedItem.setPerson(new person());
}

if (recordMode == "EDIT") {
this.selectedItemOrg = s1;
this.selectedItem = (userlogin) s1.clone();
}

if (recordMode == "READ") {
this.selectedItemOrg = s1;
this.selectedItem = (userlogin) s1.clone();
setMakeAsReadOnly(true);
win.setTitle(win.getTitle() + " (Readonly)");
}

}

@Command
public void save() {

// userlogin u1 = new userlogin();
// u1.setLoginID("sen4");
// u1.setPassword("sen4");
//
// person p1 = new person();
// p1.setEmail("senth4il@mail.com");
// p1.setFirstName("sen4thil");
// p1.setLastName("muth4iah");
// u1.setPerson(p1);
new userDAO().saveOrUpdate(this.selectedItem );
Map args = new HashMap();
args.put("newadded", this.selectedItem);
BindUtils.postGlobalCommand(null, null, "refreshList", args);
win.detach();
}
@Command
public void closeThis() {
win.detach();
}
}

userVM.java

package domainVM;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import DAO.userDAO;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;

import domain.userlogin;

public class userVM {

private List<userlogin> users = null;
private userlogin selectedItem;

public userlogin getSelectedItem() {
return selectedItem;
}

public void setSelectedItem(userlogin selectedItem) {
this.selectedItem = selectedItem;
}

public List<userlogin> getallUsers() {
if (users == null) {
users = new ArrayList<userlogin>();
users = new userDAO().getAllUsersFromDB();
}
return users;
}

@Command
public void addNewUser() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("selectedItem", null);
map.put("recordMode", "NEW");
Executions.createComponents("AddUser.zul", null, map);
}

@Command
@NotifyChange("selectedItem")
public void editThisUser() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("recordMode", "EDIT");
map.put("selectedItem", this.selectedItem);
Executions.createComponents("AddUser.zul", null, map);
}

@Command
public void openAsReadOnly() {
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("recordMode", "READ");
map.put("selectedItem", this.selectedItem);
Executions.createComponents("AddUser.zul", null, map);
}

@GlobalCommand
@NotifyChange("allUsers")
public void refreshList(@BindingParam("newadded") userlogin p1) {
users = null;
}
}







demo.zul

<?page title="Listitem MVVM Demo with Hibernate" contentType="text/html;charset=UTF-8"?>
<zk>

<style>

/* Start: Action Images- Edit
---------------------------------------------- */

.fimageedit { width: 25px; background-image:
url('./images/icon-edit.png'); background-repeat: no-repeat;
border: 0 none; cursor: pointer; }

/* End: Action Images - Edit
---------------------------------------------- */


/* Start: Action Images- Delete
---------------------------------------------- */

.fimageDelete { width: 25px; background-image:
url('./images/icon-trash-red.png'); background-repeat:
no-repeat; border: 0 none; cursor: pointer; }

/* End: Action Images - Delete
---------------------------------------------- */
.z-listcell.highlightcell .z-listcell-cnt,
.z-label.highlightcell { color:blue; cursor: pointer; }


</style>

<window title="Hibernate one to one Mapping bidirectional "
border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('myvm') @init('domainVM.userVM')">
<div>
<button label="Add User" onClick="@command('addNewUser')" />
</div>
<separator />

<listbox id="test" selectedItem="@bind(myvm.selectedItem)"
model="@load(myvm.allUsers)">
<listhead sizable="true">
<listheader label="Login ID" width="200px" />
<listheader label="Password" width="200px" />
<listheader label="First Name" width="200px" />
<listheader label="Last Name" width="285px" />
<listheader label="email" width="285px" />
<listheader label="Action" />
</listhead>
<template name="model" var="p1">
<listitem>
<listcell label="@load(p1.loginID)" />
<listcell label="@load(p1.password)" />
<listcell label="@load(p1.person.firstName)" />
<listcell label="@load(p1.person.lastName)" />
<listcell label="@load(p1.person.email)" />
<listcell>
<hbox spacing="20px">
<image sclass="fimageDelete" />
<image sclass="fimageedit"
onClick="@command('editThisUser')" />
</hbox>
</listcell>
</listitem>
</template>
</listbox>
</window>
</zk>


AddUser.zul

<zk>
<window id="win" title="User" width="520px" height="280px"
border="normal" minimizable="false" mode="modal" maximizable="false"
closable="true" action="show: slideDown;hide: slideUp"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('domainVM.UserCRUDVM')">
<separator />
<label value="User information" />
<separator />
<panel width="100%">
<panelchildren>
<separator />
<grid width="99.5%">
<columns>
<column label="" width="150px" />
<column label="" />
</columns>
<rows>
<row>
<hbox>
<label value="Login" />
<label value="*" />
</hbox>
<textbox name="Login ID" cols="50"
value="@bind(vm.selectedItem.loginID)" />
</row>
<row>
<hbox>
<label value="Password" />
<label value="*" />
</hbox>
<textbox name="Password" cols="50"
value="@bind(vm.selectedItem.password)" />
</row>

<row>
<hbox>
<label value="First Name" />
<label value="*" />
</hbox>
<textbox name="firstName" cols="50"
value="@bind(vm.selectedItem.person.firstName)" />
</row>
<row>
<hbox>
<label value="Last Name" />
<label value="*" />
</hbox>
<textbox name="firstName" cols="50"
value="@bind(vm.selectedItem.person.lastName)" />
</row>
<row>
<hbox>
<label value="email" />
<label value="*" />
</hbox>
<textbox name="email" cols="50"
value="@bind(vm.selectedItem.person.email)" />
</row>
</rows>
</grid>
</panelchildren>
</panel>
<separator />
<div align="center">
<button id="submit" label="Submit"
onClick="@command('save')" />
<button id="cancel" label="Cancel"
onClick="@command('closeThis')" />
</div>
</window>
</zk>



Now you can run demo.zul and add/edit the users

You can download source here


 

Read More
Posted in ZK Hibernate | No comments

ZK Component extend

Posted on 09:28 by Unknown

In this post, we will see how we can create our component by extending ZK Component. All the jquery plugin can be used in ZK. The following example will explain how to create Phonebox, Zip Code and Tax ID.

For your further reference, you can see the following http://www.zkoss.org/zkdemo/effects/form_effect
You can download the jquery plugin from http://digitalbush.com/projects/masked-input-plugin/

ZK Version 6
Project Name : MyComponents
Project Structure:

image

Download the jquery plugin and Add in webcontent/js folder.

Here is the source for other files

Demo.jul

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="myWin" title="new page title" border="normal" >
<label value="Phone :" />
<phonebox id="phone" width='150px' />
<label value="Extension :" />
<Extension id="txtPhoneExt" />
<label value="zipCode :" />
<ZipCode id="txtZipCode" />
<label value="Tax ID:" />
<EIN id="txtEIN" />
<label value="Alpha Numeric :" />
<AlphaNumeric />
</window>
</zk>


AlphaNumeric.java


package components;

import org.zkoss.zul.Textbox;

public class AlphaNumeric extends Textbox {
private static final long serialVersionUID = 1L;

public AlphaNumeric() {
setWidgetListener("onBind", "jq(this).mask('******');");
}
}


EIN.java

package components;
import org.zkoss.zul.Textbox;

public class EIN extends Textbox {
private static final long serialVersionUID = 1L;
public EIN() {
setWidgetListener("onBind", "jq(this).mask('99-9999999');");
}
}

Extension.java

package components;

import org.zkoss.zul.Textbox;

public class Extension extends Textbox {
private static final long serialVersionUID = 1L;

public Extension() {
setWidgetListener("onBind", "jq(this).mask('99999');");
}
}

NPI.java

package components;

import org.zkoss.zul.Textbox;

public class NPI extends Textbox {
private static final long serialVersionUID = 1L;
public NPI() {
setWidgetListener("onBind", "jq(this).mask('9999999999');");
}
}

Phonebox.java

package components;
import org.zkoss.zul.Textbox;

public class Phonebox extends Textbox {
private static final long serialVersionUID = 1L;
public Phonebox() {
setWidgetListener("onBind", "jq(this).mask('(999) 999-9999');");
}
}

ZipCode.java

package components;

import org.zkoss.zul.Textbox;

public class ZipCode extends Textbox {
private static final long serialVersionUID = 1L;

public ZipCode() {
setWidgetListener("onBind", "jq(this).mask('99999-9999');");
}
}


In the webcontent folder, create a file in the name of my-addon.xml (you can keep any file name)


<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<addon-name>ecosmos</addon-name>
<language-name>xul/html</language-name>

<component>
<component-name>phonebox</component-name>
<component-class>components.Phonebox
</component-class>
<extends>textbox</extends>
</component>

<component>
<component-name>EIN</component-name>
<component-class>components.EIN</component-class>
<extends>textbox</extends>
</component>

<component>
<component-name>NPI</component-name>
<component-class>components.NPI</component-class>
<extends>textbox</extends>
</component>

<component>
<component-name>Extension</component-name>
<component-class>components.Extension
</component-class>
<extends>textbox</extends>
</component>


<component>
<component-name>ZipCode</component-name>
<component-class>components.ZipCode
</component-class>
<extends>textbox</extends>
</component>

<component>
<component-name>AlphaNumeric</component-name>
<component-class>components.AlphaNumeric
</component-class>
<extends>textbox</extends>
</component>





<addon-name>my.extension</addon-name><!-- any name you like -->
<javascript src="js/jquery.maskedinput-1.3.js" /> <!-- assume you package it as /myjs/foo.js -->

</language-addon>


And in the ZK.Xml , add the reference for the above file as follows


<?xml version="1.0" encoding="UTF-8"?>

<!-- Created by ZK Studio -->

<zk>
<device-config>
<device-type>ajax</device-type>
<timeout-uri>/timeout.zul</timeout-uri><!-- An empty URL can cause the
browser to reload the same URL -->
</device-config>


<language-config>
<addon-uri>/WEB-INF/my-addon.xml</addon-uri>
</language-config>

</zk>


Now you can run the demo.zul and check the output


image


You can download source here

Read More
Posted in ZK extended Components | No comments

Tuesday, 3 July 2012

ZK Messagebox Styling

Posted on 18:45 by Unknown

This examples show how you can use change the Look and Feel of ZK MessageBox Component.

ZK Version 6
Project Name : MessageBoxStyle
Project Structure:

image

index.zul

<zk>

<style>
.z-messagebox-btn
{
font-size: 11px;
padding: .2em 1em .275em;
}

.z-messagebox-btn
{
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}

.z-messagebox-btn
{
color: #fef4e9;
border: solid 1px #da7c0c;
background: #f78d1d;
background: -webkit-gradient(linear, left top, left bottom, from(#ffac53), to(#fe7d1e));
background: -moz-linear-gradient(top, #ffac53, #fe7d1e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffac53', endColorstr='#fe7d1e');
padding: 3px 5px 3px 5px;
}

.z-messagebox-btn:hover
{
background: #f47c20;
background: -webkit-gradient(linear, left top, left bottom, from(#fe7d1e), to(#ffac53));
background: -moz-linear-gradient(top, #fe7d1e, #ffac53);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe7d1e', endColorstr='#ffac53');
padding: 4px 5px 2px 5px;
}


.z-messagebox-btn.z-button .z-button-cm
{
background-image: none;
color: white;
font-weight : bolder;
}

.z-messagebox-btn.z-button .z-button-tm, .z-button .z-button-bm
{
background-image: none;
}

.z-messagebox-btn.z-button .z-button-cl, .z-button .z-button-cr
{
background-image: none;
}

.z-messagebox-btn.z-button .z-button-tl
{
background-image: none;
}

.z-messagebox-btn.z-button .z-button-bl
{
background-image: none;
}

.z-messagebox-btn.z-button .z-button-tr
{
background-image: none;
}

.z-messagebox-btn.z-button .z-button-br
{
background-image: none;
}


.z-messagebox-window .z-window-highlighted-hm, .z-window-highlighted-br,
.z-window-highlighted-cr, .z-window-highlighted-cl,
.z-window-highlighted-hr, .z-window-highlighted-tr,
.z-window-highlighted-hl
{
background-image:none; background-color : #0C6BA8;
}

.z-messagebox-window .z-window-highlighted-header
{
padding-top : 1px;
padding-right : -1px;
padding-bottom : 1px;
padding-left : 0;
margin-right: -4px;
color:white;
font-family: "Tahoma", verdana,arial,sans-serif;
font-size: 12px;
font-weight : bolder;
}

.z-messagebox-window .z-window-highlighted-icon
{
width: 20px; height: 16px;
border-width: 1px; border-style: solid; border-color: #0C6BA8
#0C6BA8 #0C6BA8 #0C6BA8; box-shadow: inset 0 1px 0 #0C6BA8,
inset -1px -1px 0 #0C6BA8, inset -1px -2px 0 #0C6BA8;
}

.z-messagebox-window .z-window-highlighted-close
{
background:url('./images/close.jpg')
transparent no-repeat 0 0;
}


</style>

<vlayout spacing="15px">
Message Dialog
<hlayout>
<button label="Warning" width="100px">
<attribute name="onClick"><![CDATA[
Messagebox.show("Warning is pressed", "Warning", Messagebox.OK,
Messagebox.EXCLAMATION);
]]></attribute>
</button>
<button label="Question" width="100px">
<attribute name="onClick"><![CDATA[
Messagebox.show("Question is pressed. Are you sure?", "Question",
Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);
]]></attribute>
</button>
<button label="Information" width="100px">
<attribute name="onClick"><![CDATA[
Messagebox.show("Information is pressed", "Information", Messagebox.OK,
Messagebox.INFORMATION);
]]></attribute>
</button>
<button label="Error" width="100px">
<attribute name="onClick"><![CDATA[
Messagebox.show("Error is pressed", "Error", Messagebox.OK,
Messagebox.ERROR);
]]></attribute>
</button>
</hlayout>
Interactive Dialog
<button label="Save " width="100px">
<attribute name="onClick"><![CDATA[
Messagebox.show("Are you sure to save?", "Confirm Dialog", Messagebox.OK | Messagebox.IGNORE | Messagebox.CANCEL, Messagebox.QUESTION, new org.zkoss.zk.ui.event.EventListener() {
public void onEvent(Event evt) throws InterruptedException {
if (evt.getName().equals("onOK")) {
alert("Data Saved !");
} else if (evt.getName().equals("onIgnore")) {
Messagebox.show("Ignore Save", "Warning", Messagebox.OK,
Messagebox.EXCLAMATION);
} else {
alert("Save Canceled !");
}
}
});
]]></attribute>
</button>
</vlayout>
</zk>

 

Output

 

image

 

image

 

image

 

image

 

image

 

You can download source here

Read More
Posted in ZK CSS | No comments

Monday, 2 July 2012

EDI 5010 Documentation 837 Professional - Loop 2300 Claim Information

Posted on 04:40 by Unknown

        

2300 Claim information

Loop Seg ID Segment Name Format Length Ref# Req Value
2300 CLM Claim information ID 3 R CLM
Element Separator AN 1 *
CLM01 Claim Submitter Identifier AN 1/38 1028 R Unique Claim Number
Element Separator AN 1 *
CLM02 Monetary Amount R 1/18 782 R Total Charges
Element Separator AN 1 *
CLM03 Claim Filling Indicator       Not Used  
Element Separator AN 1 *
CLM04 Non Institutional Claim Type       Not Used  
Element Separator AN 1 *
CLM05-1 Facility Code Value AN 1/2 1331 R Place of Service Code
Component Element Separator   :
CLM05-2 Facility Code Qualifier ID 1/2   R B
Component Element Separator   :
CLM05-3 Claim Frequency Type Code ID 1 1325 R 1 = Original
2 = Replacement
8 = Void
Element Separator AN 1 *
CLM06 Yes/No Provider Signature on File ID 1 1073 R Y
Element Separator AN 1 *
CLM07 Provider Accept Assignment Code ID 1 1359 R A = Assigned
B = Assignment Accepted on Clinical Lab Services Only
C = Not Assigned
Element Separator AN 1 *
CLM08 Yes/No Assignments of Benefit ID 1 1073 R Y
Element Separator AN 1 *
CLM09 Yes/No Release of Information ID 1 1363 R Y
Element Separator AN 1 *
CLM10 Patient signature source code ID 1 1351 S P
Element Separator AN 1 *
               
               
               
               

Examples:

CLM*249*60***11:B:1*Y*A*Y*Y

CLM*250*38***11:B:1*Y*A*Y*Y

********************************************************************************

Example : 2
Claim Setup

Field

Value

Claim No

252

Claim Location

NY Office

Place of Service

11 - Office

Rendering Provider

David Mark

ICD Code

410,415, 368.34, 522.3

Line items

Procedure Code

Mod1

Mod2

Mod3

Mod4

ICD

FromDOS

ToDOS

Units

Unit Charges

99214

1,2,3,4

01/09/2012

01/09/2012

1

40

92570

1

01/09/2012

01/09/2012

1

180.04

90371

3,4

01/09/2012

01/09/2012

1

83


CLM*252*303.04***11:B:1*Y*A*Y*Y~

By Loop
2300 - Claim Information CLM CLM*252*303.04***11:B:1*Y*A*Y*Y~
2300 - Claim Information - Clia Number REF REF*X4*CL324234~
2300 - Claim Information - ICDs HI HI*BK:410*BF:415*BF:36834*BF:5223~
2310B - Rendering Provider Name NM1 NM1*82*1*Mark*David****XX*1111111111~
2310D - Service Facility Location NM1 NM1*77*2*NY Office*****XX*1336177328~
2310D - Service Facility Location N3 N3*5081 Tellus. Avenue*668-2204 Non Rd.~
2310D - Service Facility Location N4 N4*White Plains*NY*809051232~
2310D - Service Facility Location REF REF*LU*484345~
2400 - Service Line LX LX*1~
2400 - Service Line SV1 SV1*HC:99214*40*UN*1*11**1:2:3:4~
2400 - Service Line DTP DTP*472*RD8*20120109-20120109~
2400 - Service Line REF REF*6R*1140~
2400 - Service Line LX LX*2~
2400 - Service Line SV1 SV1*HC:92570*180.04*UN*1*11**1~
2400 - Service Line DTP DTP*472*RD8*20120109-20120109~
2400 - Service Line REF REF*6R*1141~
2400 - Service Line LX LX*3~
2400 - Service Line SV1 SV1*HC:90371*83*UN*1*11**3:4~
2400 - Service Line DTP DTP*472*RD8*20120109-20120109~
2400 - Service Line REF REF*6R*1142~





        

Questions or feedback are always welcome. You can email me at vbsenthilinnet@gmail.com.
You can hire me as consultant for EMR/PMS Domain and Web development on EMR/PMS Product!
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Understanding EDI Structure
    EDI Structure Primary Levels are 1. Interchange Envelops 2. Functional Group 3. Transaction set Data Element A data element is equival...
  • Types of Reimbursement
    Fee-For-Service Fee-for-service is a method of payment where the provider is paid a fee for each procedure performed and billed.Most payer ...
  • ZK ListBox
    Let us first design a simple  static list box with crud Buttons as last column. Here is the code <?page title="Practice List" c...
  • Java Static Import
    This is one of feature in Java 5. In order to access static members, it is necessary to qualify references with the class they came from. ...
  • ZK MVVM CRUD With Spring 3 + JPA + Hibernate 4 Entity Manager–Part 5
    DAO and Service Layer for CRUD operation. In the Part 4 article, we have seen how to integrate spring and hibernate. Now we create the DAO...
  • One to many mapping using bidirectional relationship – onetoMany as Owner
    First let us look the hibernate documentation on this as follows To map a bidirectional one to many, with the one-to-many side as the owni...
  • EDI Instructions
    HIPAA Compliant Codes All the Health care EDI Transaction set should use only the following HIPAA Compliant Codes Physicians Current Pro...
  • ZK MVVM CRUD With Spring 3 + JPA + Hibernate 4 Entity Manager–Part 3
    Define the persistence.xml file In the Part 2 article , we have seen how to create ZK Maven project and update the default POM.XML with a...
  • ZK MVVM Form Binding CRUD with Spring and Hibernate
    In this series of articles, we will see examples for various concept of ZK Framework. About the application This is a small application to ...
  • Hibernate–Java Environment setup
    Environment Eclipse 3.7 Indigo IDE Download Hibernate 4.1.1 Download JavaSE 1.6  Download MySQL 5.1 Download JDBC Driver for MyS...

Categories

  • Billing Process
  • C Workbook
  • C++ Workbook
  • Eclipse Tips
  • EDI 5010
  • EMR Appointment Features
  • EMR Labs Stuff
  • EMR PMS Links
  • EMR Use cases
  • EMR Vital Sign
  • Good Website Design
  • Hibernate Criteria Queries
  • Hibernate Introduction
  • Hibernate Introduction Setup
  • Hibernate Mapping
  • Hibernate POC
  • Hibernate Validator
  • Hibernate–Java Environment setup
  • HPI
  • Java
  • Maven
  • MU Certification
  • NPI
  • PQRS
  • Practice Management System
  • Spring Security
  • Tech Links
  • Today Tech Stuff
  • zk
  • ZK Hibernate
  • ZK 5 Databinding
  • ZK Application
  • ZK Calling Another ZUL
  • ZK CheckBox
  • ZK CreateComponents
  • ZK CSS
  • ZK extended Components
  • ZK Foreach
  • ZK Forum Posts
  • ZK Framework
  • ZK Hibernate Setup
  • ZK ID Space
  • ZK Include
  • ZK Installation
  • ZK iReport
  • ZK Layout
  • ZK Listitem Pagination
  • ZK Message Box
  • ZK MVC
  • ZK MVC Combox Box
  • ZK MVC CRUD Examples
  • ZK MVC Listbox
  • ZK MVVM
  • ZK MVVM Combo
  • ZK MVVM CRUD
  • ZK MVVM ListBox
  • ZK Spring
  • ZK TextBox

Blog Archive

  • ▼  2013 (105)
    • ▼  December (3)
      • EDI Instructions
      • Understanding EDI Structure
      • What is an EDI ?
    • ►  September (7)
    • ►  August (13)
    • ►  July (1)
    • ►  June (11)
    • ►  May (3)
    • ►  April (14)
    • ►  March (19)
    • ►  February (21)
    • ►  January (13)
  • ►  2012 (177)
    • ►  December (1)
    • ►  November (13)
    • ►  October (19)
    • ►  September (24)
    • ►  August (26)
    • ►  July (6)
    • ►  June (37)
    • ►  May (30)
    • ►  April (16)
    • ►  March (1)
    • ►  January (4)
  • ►  2011 (5)
    • ►  December (1)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
  • ►  2010 (1)
    • ►  September (1)
Powered by Blogger.

About Me

Unknown
View my complete profile