e.Toscana Compliance 
Request for Comments: 
Del: 18/01/2007 
Categoria: Applicativa
Destinatari: Regione Toscana, Aziende USL

	Pagamento ticket sanitari
	
Indice
======
1. Contesto di riferimento		 
2. Obiettivi		 
3. Analisi 
4. Prodotti attesi
5. Bibliografia


1. Contesto di riferimento
==========================
Il documento nasce come risultato del progetto T-Pago che ha permesso al comune di Prato e alla USL 4 di Prato 
di collaborare per creare un nuovo canale di riscossione dei ticket sanitari attraverso il circuito T-Serve.
Il circuito T-Serve è costituito da una rete di sportelli autorizzati, costituita principalmente da tabaccherie 
e agenzie bancarie, che grazie ad un collegamento ad internet su un sito protetto del comune riscuotono 
per conto del comune stesso e di altri enti o società pubbliche.

2. Obiettivi
==========================
Lo scopo del documento è quello di definire delle specifiche su cui costruire un sistema di interscambio dati 
standard tra sistemi che implementano servizi di pagamento e sistemi informativi locali delle USL 
con la finalità di ampliare il più possibile i canali di riscossione. 
Il documento descrive le modalità di ricerca e di registrazione di pagamento di ticket sanitari gestiti dalle varie
USL attraverso l'utilizzo di uno web service. 
L'obiettivo e' quello di favorire da un lato lo sviluppo di circuiti alternativi ai canali tradizionali che 
permettano ai cittadini di scegliere le modalità di pagamento più vicine alle loro esigenze e nel contempo 
di ridurre il lavoro di back-office delle USL.

I vantaggi sono :
* disaccoppiamento tra sistema USL e servizi di riscossione
* lettura diretta sugli archivi USL dei ticket da pagare con riduzione degli errori
* registrazione in tempo reale del pagamento
* alleggerimento del lavoro di back-office della USL e del lavoro di controllo


3. Analisi
==========
Lo web service per interrogare e registrare i pagamenti dei ticket permette di sviluppare:

a) servizi interattivi su circuiti come T-Serve 
b) servizi di pagamento su internet con carta di credito
c) servizi di pagamento su terminali self-service

Il wsdl che descrive lo web service è il seguente:

-------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions 
xmlns:tns="http://ws.tpago.org/tpagoService"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsd1="http://ws.tpago.org/types" 
xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
targetNamespace="http://ws.tpago.org/tpagoService">
  <types>
		<xsd:schema targetNamespace="http://ws.tpago.org/types">
			<xsd:complexType name="Soggetto">
				<xsd:annotation>
					<xsd:documentation>xsd per soggetto</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="Cognome" type="xsd:string"/>
					<xsd:element name="Nome" type="xsd:string"/>
					<xsd:element name="Sesso" type="xsd:string"/>
					<xsd:element name="DataNascita" type="xsd:string"/>
					<xsd:element name="LuogoNascita" type="xsd:string"/>
					<xsd:element name="CodiceFiscale">
						<xsd:simpleType>
							<xsd:restriction base="xsd:string">
								<xsd:maxLength value="16"/>
							</xsd:restriction>
						</xsd:simpleType>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="RigaPrenotazione">
				<xsd:annotation>
					<xsd:documentation>riga prenotazione</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdRigaPrenotazione" type="xsd:string"/>
					<xsd:element name="CodiceErogatore" type="xsd:string"/>
					<xsd:element name="EnteErogatore" type="xsd:string"/>
					<xsd:element name="TipoPrestazione" type="xsd:string"/>
					<xsd:element name="Importo" type="xsd:string"/>
					<xsd:element name="FlgPagabile" type="xsd:string"/>
					<xsd:element name="CodicePagabile" type="xsd:string" minOccurs="0"/>
					<xsd:element name="DataInizioErogazione" type="xsd:string"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="Prenotazione">
				<xsd:annotation>
					<xsd:documentation>prenotazione</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdPrenotazione" type="xsd:string"/>
					<xsd:element name="DataPrenotazione" type="xsd:string"/>
					<xsd:element name="ImportoTotale" type="xsd:string"/>
					<xsd:element name="RighePrenotazione" type="xsd1:RigaPrenotazione" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="PrenotazioneCompleta">
				<xsd:annotation>
					<xsd:documentation>prenotazione completa</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="Soggetto" type="xsd1:Soggetto"/>
					<xsd:element name="Prenotazione" type="xsd1:Prenotazione"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="RegistrazionePagamento">
				<xsd:annotation>
					<xsd:documentation>xsd per registrazione pagamento</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdRicevuta" type="xsd:string"/>
					<xsd:element name="Canale" type="xsd:string"/>
					<xsd:element name="ListaRighePrenotazione" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element name="Importo" type="xsd:string"/>
					<xsd:element name="ImportoBollo" type="xsd:string"/>
					<xsd:element name="DataPagamento" type="xsd:string"/>
					<xsd:element name="OraPagamento" type="xsd:string"/>
					<xsd:element name="Operatore" type="xsd:string" minOccurs="0"/>
					<xsd:element name="Cassa" type="xsd:string" minOccurs="0"/>
					<xsd:element name="StringaAntifalsificazione" type="xsd:string" minOccurs="0"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="Ricevuta">
				<xsd:annotation>
					<xsd:documentation>xsd per ricevuta pagamento</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdRicevuta" type="xsd:string"/>
					<xsd:element name="IdTransazione" type="xsd:string"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="RichiestaStorno">
				<xsd:annotation>
					<xsd:documentation>xsd per chiesta storno</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdRicevuta" type="xsd:string"/>
					<xsd:element name="IdTransazione" type="xsd:string"/>
					<xsd:element name="DataStorno" type="xsd:string"/>
					<xsd:element name="OraStorno" type="xsd:string"/>
					<xsd:element name="Operatore" type="xsd:string" minOccurs="0"/>
					<xsd:element name="Cassa" type="xsd:string" minOccurs="0"/>
					<xsd:element name="Canale" type="xsd:string" minOccurs="0"/>
					<xsd:element name="StringaAntifalsificazione" type="xsd:string" minOccurs="0"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="PagamentoInatteso">
				<xsd:annotation>
					<xsd:documentation>xsd per pagamento inatteso</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="IdRicevuta" type="xsd:string"/>
					<xsd:element name="Cognome" type="xsd:string"/>
					<xsd:element name="Nome" type="xsd:string"/>
					<xsd:element name="CodiceFiscale" type="xsd:string" minOccurs="0"/>
					<xsd:element name="Causale" type="xsd:string" minOccurs="0"/>
					<xsd:element name="CodiceRichiesta" type="xsd:string" minOccurs="0"/>
					<xsd:element name="DataPrestazione" type="xsd:string"/>
					<xsd:element name="Importo" type="xsd:string"/>
					<xsd:element name="ImportoBollo" type="xsd:string"/>
					<xsd:element name="DataPagamento" type="xsd:string"/>
					<xsd:element name="OraPagamento" type="xsd:string"/>
					<xsd:element name="Canale" type="xsd:string"/>
					<xsd:element name="Operatore" type="xsd:string" minOccurs="0"/>
					<xsd:element name="Cassa" type="xsd:string" minOccurs="0"/>
					<xsd:element name="StringaAntifalsificazione" type="xsd:string"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:complexType name="Esito">
				<xsd:annotation>
					<xsd:documentation>esito richiesta</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="CodiceEsito" type="xsd:string"/>
					<xsd:element name="Messaggio" type="xsd:string"/>
				</xsd:sequence>
			</xsd:complexType>
			<xsd:element name="GetSoggettiRequest">
				<xsd:annotation>
					<xsd:documentation>richiesta anagrafiche: ricerca per cognome, nome e data di nascita</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Cognome" type="xsd:string"/>
						<xsd:element name="Nome" type="xsd:string"/>
						<xsd:element name="DataNascita" type="xsd:string" minOccurs="0"/>
						<xsd:element name="RicercaParziale" type="xsd:string"/>
						<xsd:element name="NumeroOminimi" type="xsd:integer"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetSoggettiResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a richiesta anagrafiche</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Soggetti" type="xsd1:Soggetto" minOccurs="0" maxOccurs="unbounded"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetSoggettoRequest">
				<xsd:annotation>
					<xsd:documentation>richiesta anagrafica: ricerca per codice fiscale</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="CodiceFiscale" type="xsd:string"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetSoggettoResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a richiesta anagrafica</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Soggetto" type="xsd1:Soggetto" minOccurs="0" maxOccurs="1"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetPrenotazioniRequest">
				<xsd:annotation>
					<xsd:documentation>richiesta prenotazioni di un soggetto</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="CodiceFiscale" type="xsd:string"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetPrenotazioniResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a richiesta prenotazioni</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Prenotazioni" type="xsd1:Prenotazione" minOccurs="0" maxOccurs="unbounded"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetPrenotazioneRequest">
				<xsd:annotation>
					<xsd:documentation>richiesta prenotazione completa: deve esistere almeno un parametro di ricerca</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="IdPrenotazione" type="xsd:string" minOccurs="0"/>
						<xsd:element name="CodiceRichiesta" type="xsd:string" minOccurs="0"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="GetPrenotazioneResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a richiesta prenotazione completa</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Prenotazione" type="xsd1:PrenotazioneCompleta" minOccurs="0" maxOccurs="1"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="RegistraPagamentoRequest" type="xsd1:RegistrazionePagamento">
				<xsd:annotation>
					<xsd:documentation>registrazione pagamento atteso</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="RegistraPagamentoResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a registrazione pagamento</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Esito" type="xsd1:Esito"/>
						<xsd:element name="Ricevuta" type="xsd1:Ricevuta"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="RegistraPagamentoInattesoRequest" type="xsd1:PagamentoInatteso">
				<xsd:annotation>
					<xsd:documentation>registrazione pagamento inatteso</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="RegistraPagamentoInattesoResponse">
				<xsd:annotation>
					<xsd:documentation>risposta a registrazione pagamento inatteso</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Esito" type="xsd1:Esito"/>
						<xsd:element name="Ricevuta" type="xsd1:Ricevuta"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="RichiestaStornoRequest" type="xsd1:RichiestaStorno">
				<xsd:annotation>
					<xsd:documentation>richiesta storno</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="RichiestaStornoResponse" type="xsd1:Esito">
				<xsd:annotation>
					<xsd:documentation>risposta a rechiesta storno</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:schema>
	</types>
	<message name="GetSoggettiRequest">
		<part name="GetSoggettiRequest" element="xsd1:GetSoggettiRequest"/>
	</message>
	<message name="GetSoggettiResponse">
		<part name="GetSoggettiResponse" element="xsd1:GetSoggettiResponse"/>
	</message>
	<message name="GetSoggettoRequest">
		<part name="GetSoggettoRequest" element="xsd1:GetSoggettoRequest"/>
	</message>
	<message name="GetSoggettoResponse">
		<part name="GetSoggettoResponse" element="xsd1:GetSoggettoResponse"/>
	</message>
	<message name="GetPrenotazioniRequest">
		<part name="GetPrenotazioniRequest" element="xsd1:GetPrenotazioniRequest"/>
	</message>
	<message name="GetPrenotazioniResponse">
		<part name="GetPrenotazioniResponse" element="xsd1:GetPrenotazioniResponse"/>
	</message>
	<message name="GetPrenotazioneRequest">
		<part name="GetPrenotazioneRequest" element="xsd1:GetPrenotazioneRequest"/>
	</message>
	<message name="GetPrenotazioneResponse">
		<part name="GetPrenotazioneResponse" element="xsd1:GetPrenotazioneResponse"/>
	</message>
	<message name="RegistraPagamentoRequest">
		<part name="RegistraPagamentoRequest" element="xsd1:RegistraPagamentoRequest"/>
	</message>
	<message name="RegistraPagamentoResponse">
		<part name="RegistraPagamentoResponse" element="xsd1:RegistraPagamentoResponse"/>
	</message>
	<message name="RegistraPagamentoInattesoRequest">
		<part name="RegistraPagamentoInattesoRequest" element="xsd1:RegistraPagamentoInattesoRequest"/>
	</message>
	<message name="RegistraPagamentoInattesoResponse">
		<part name="RegistraPagamentoInattesoResponse" element="xsd1:RegistraPagamentoInattesoResponse"/>
	</message>
	<message name="RichiestaStornoRequest">
		<part name="RichiestaStornoRequest" element="xsd1:RichiestaStornoRequest"/>
	</message>
	<message name="RichiestaStornoResponse">
		<part name="RichiestaStornoResponse" element="xsd1:RichiestaStornoResponse"/>
	</message>
	<portType name="tpagoService">
		<operation name="GetSoggetti">
			<input message="tns:GetSoggettiRequest"/>
			<output message="tns:GetSoggettiResponse"/>
		</operation>
		<operation name="GetSoggetto">
			<input message="tns:GetSoggettoRequest"/>
			<output message="tns:GetSoggettoResponse"/>
		</operation>
		<operation name="GetPrenotazioni">
			<input message="tns:GetPrenotazioniRequest"/>
			<output message="tns:GetPrenotazioniResponse"/>
		</operation>
		<operation name="GetPrenotazione">
			<input message="tns:GetPrenotazioneRequest"/>
			<output message="tns:GetPrenotazioneResponse"/>
		</operation>
		<operation name="RegistraPagamento">
			<input message="tns:RegistraPagamentoRequest"/>
			<output message="tns:RegistraPagamentoResponse"/>
		</operation>
		<operation name="RegistraPagamentoInatteso">
			<input message="tns:RegistraPagamentoInattesoRequest"/>
			<output message="tns:RegistraPagamentoInattesoResponse"/>
		</operation>
		<operation name="RichiestaStorno">
			<input message="tns:RichiestaStornoRequest"/>
			<output message="tns:RichiestaStornoResponse"/>
		</operation>
	</portType>
	<binding name="tpagoServiceSOAP" type="tns:tpagoService">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="GetSoggetti">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/GetSoggetti"/>
			<input name="GetSoggettiRequest">
				<soap:body use="literal"/>
			</input>
			<output name="GetSoggettiResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="GetSoggetto">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/GetSoggetto"/>
			<input name="GetSoggettoRequest">
				<soap:body use="literal"/>
			</input>
			<output name="GetSoggettoResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="GetPrenotazioni">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/GetPrenotazioni"/>
			<input name="GetPrenotazioniRequest">
				<soap:body use="literal"/>
			</input>
			<output name="GetPrenotazioniResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="GetPrenotazione">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/GetPrenotazione"/>
			<input name="GetPrenotazioneRequest">
				<soap:body use="literal"/>
			</input>
			<output name="GetPrenotazioneResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="RegistraPagamento">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/RegistraPagamento"/>
			<input name="RegistraPagamentoRequest">
				<soap:body use="literal"/>
			</input>
			<output name="RegistraPagamentoResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="RegistraPagamentoInatteso">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/RegistraPagamentoInatteso"/>
			<input name="RegistraPagamentoInattesoRequest">
				<soap:body use="literal"/>
			</input>
			<output name="RegistraPagamentoInattesoResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
		<operation name="RichiestaStorno">
			<soap:operation soapAction="http://ws.tpago.org/tpagoService/RichiestaStorno"/>
			<input name="RichiestaStornoRequest">
				<soap:body use="literal"/>
			</input>
			<output name="RichiestaStornoResponse">
				<soap:body use="literal"/>
			</output>
		</operation>
	</binding>
	<service name="tpagoService">
		<port name="tpagoServiceSOAP" binding="tns:tpagoServiceSOAP">
			<soap:address location="http://ws.tpago.org/tpagoService"/>
		</port>
	</service>
</definitions>


-------------------------------------------------------------------------------



5. Bibliografia
===============
[1] Web Services: http://www.w3.org/2002/ws/
[2] XML Schema http://www.w3.org/XML/Schema
