/**
 * do all the "wiring" needed tp run the app
 * @author maulin
 */
dojo.provide("medryx.context");
dojo.require("medryx.data.BeanStore");
dojo.require("medryx.model.Provider");
dojo.require("medryx.model.Team");
dojo.require("medryx.model.Patient");
dojo.require("medryx.config");

(function() {
	medryx.context ={};
	var ctx = medryx.context;
	
	ctx.providerStore = new medryx.data.BeanStore({
		service: medryx.config.providerService,
		target:"/provider/",
		schema:medryx.model.Provider,
		cacheByDefault:true
	});
	ctx.providerStore.fetch(); //initialize the store with a "fetch all"
	
	ctx.teamStore = new medryx.data.BeanStore({
		service: medryx.config.teamService,
		target:"/team/",
		schema:medryx.model.Team,
		cacheByDefault:true
	});
	ctx.teamStore.fetch();
	
	ctx.patientStore = new medryx.data.BeanStore({
		service: medryx.config.patientService,
		target:"/patient/",
		schema:medryx.model.Patient,
		cacheByDefault:true
	});
	ctx.patientStore.fetch();
	
	
	/*
	ctx.teamPagerStore = new medryx.data.BeanStore({
		service: medryx.config.teamPagerService,
		target:"/teamPager",
		schema:medryx.model.TeamPager,
		cacheByDefault:true
	});
	
	ctx.pagerStore = new medryx.data.BeanStore({
		service: medryx.config.pagerService,
		target:"/pager",
		schema:medryx.model.Pager,
		cacheByDefault:true
	});
	
	
	
	
	
	ctx.visitStore = new medryx.data.BeanStore({
		service: medryx.config.visitService,
		target:"/visit",
		schema:medryx.model.Visit,
		cacheByDefault:true
	});
	*/
	//ctx.pageService = new medryx.config.rpc.pageServiceProvider(medryx.rpc.PageService);
})();

